Skip to content

Commit

Permalink
add test for generator decorator return
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Jan 23, 2024
1 parent b1c45cd commit 6252b92
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/unit/test_vcr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6252b92

Please sign in to comment.