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

Compare commits

...

4 Commits

Author SHA1 Message Date
Kevin McCarthy
68038d0559 release v6.0.1 2024-01-25 11:13:56 -05:00
Thomas Grainger
f76289aa78 Merge pull request #811 from kevin1024/graingert-patch-1
return values from generator decorator
2024-01-24 13:22:32 +00:00
Thomas Grainger
6252b92f50 add test for generator decorator return 2024-01-23 17:29:35 +00:00
Thomas Grainger
b1c45cd249 return values from generator decorator 2024-01-23 15:07:23 +00:00
4 changed files with 20 additions and 2 deletions

View File

@@ -7,6 +7,8 @@ For a full list of triaged issues, bugs and PRs and what release they are target
All help in providing PRs to close out bug issues is appreciated. Even if that is providing a repo that fully replicates issues. We have very generous contributors that have added these to bug issues which meant another contributor picked up the bug and closed it out.
- 6.0.1
- Bugfix with to Tornado cassette generator (thanks @graingert)
- 6.0.0
- BREAKING: Fix issue with httpx support (thanks @parkerhancock) in #784. NOTE: You may have to recreate some of your cassettes produced in previous releases due to the binary format being saved incorrectly in previous releases
- BREAKING: Drop support for `boto` (vcrpy still supports boto3, but is dropping the deprecated `boto` support in this release. (thanks @jairhenrique)

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

View File

@@ -4,7 +4,7 @@ from logging import NullHandler
from .config import VCR
from .record_mode import RecordMode as mode # noqa: F401
__version__ = "6.0.0"
__version__ = "6.0.1"
logging.getLogger(__name__).addHandler(NullHandler())

View File

@@ -125,7 +125,7 @@ class CassetteContextDecorator:
duration of the generator.
"""
with self as cassette:
yield from fn(cassette)
return (yield from fn(cassette))
def _handle_function(self, fn):
with self as cassette: