1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00

add test for generator decorator return

This commit is contained in:
Thomas Grainger
2024-01-23 17:29:35 +00:00
parent b1c45cd249
commit 6252b92f50

View File

@@ -372,3 +372,19 @@ def test_path_class_as_cassette():
)
with use_cassette(path):
pass
def test_use_cassette_generator_return():
ret_val = object()
vcr = VCR()
@vcr.use_cassette("test")
def gen():
return ret_val
yield
with pytest.raises(StopIteration) as exc_info:
next(gen())
assert exc_info.value.value is ret_val