]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
Add failing test for session still being attached to cassette after context is gone.
authorIvan Malison <IvanMalison@gmail.com>
Fri, 19 Sep 2014 00:03:13 +0000 (17:03 -0700)
committerIvan Malison <IvanMalison@gmail.com>
Fri, 19 Sep 2014 00:03:13 +0000 (17:03 -0700)
tests/integration/test_requests.py

index 3139ac570b382574fb1bb7c0fa70ee499d22e7c3..e36da188fcd926fca1e8db6703d453c7b16aeec4 100644 (file)
@@ -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