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

Make cassette active for duration of coroutine/generator

Closes #177.
This commit is contained in:
Ivan Malison
2015-07-30 01:47:29 -07:00
parent 4fb5bef8e1
commit 21c176ee1e
5 changed files with 138 additions and 29 deletions

View File

@@ -275,3 +275,12 @@ def test_cannot_overwrite_cassette_raise_error_disabled(get_client, tmpdir):
)
assert isinstance(response.error, CannotOverwriteExistingCassetteException)
@pytest.mark.gen_test
@vcr.use_cassette
def test_tornado_with_decorator_use_cassette(get_client):
response = yield get_client().fetch(
http.HTTPRequest('http://www.google.com/', method='GET')
)
assert response.body == "not actually google"