From: Ivan Malison Date: Fri, 19 Sep 2014 00:03:13 +0000 (-0700) Subject: Add failing test for session still being attached to cassette after context is gone. X-Git-Tag: v1.1.0^2~10 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=8947f0fc5c1ec2d1a238351f419fe247b4f002c5;p=vcrpy.git Add failing test for session still being attached to cassette after context is gone. --- diff --git a/tests/integration/test_requests.py b/tests/integration/test_requests.py index 3139ac5..e36da18 100644 --- a/tests/integration/test_requests.py +++ b/tests/integration/test_requests.py @@ -152,6 +152,18 @@ def test_https_with_cert_validation_disabled(tmpdir): requests.get('https://httpbin.org', verify=False) +def test_session_can_make_requests_after_requests_unpatched(tmpdir): + with vcr.use_cassette(str(tmpdir.join('test_session_after_unpatched.yaml'))): + session = requests.session() + session.get('http://httpbin.org/get') + + with vcr.use_cassette(str(tmpdir.join('test_session_after_unpatched.yaml'))): + session = requests.session() + session.get('http://httpbin.org/get') + + session.get('http://httpbin.org/status/200') + + def test_nested_context_managers_with_session_created_before_first_nesting(scheme, tmpdir): ''' This tests ensures that a session that was created while one cassette was