vcr doesn't record requests used within a library?
See original GitHub issueI am using github3, and want to test it. This is what I used:
1 import os
2
3 import vcr
4 import github3
5
6 @vcr.use_cassette('github.yaml')
7 def test_github3():
8 gh = github3.GitHub(token=os.environ.get('GH_TOKEN'))
9 coala = gh.organization('coala')
when I run this test, the cassete is not recorded
github3
uses a GitHubSession
session which inherits from requests.Session
internally
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
vcrpy record cassettes doesn't record in a test using test_client ...
I wrote a test but I would like to record the response of the request and vcr is not recording the response. My...
Read more >vcr: Record 'HTTP' Calls to Disk
Works by hooking into the 'webmockr'. R package for matching 'HTTP' requests by various rules ('HTTP' method,. 'URL', query parameters, headers, ...
Read more >Advanced Features — vcrpy 4.2.1 documentation
If you want, VCR.py can return information about the cassette it is using to record your requests and responses. This will let you...
Read more >Configuration - PHP-VCR
Library hooks can only intercept HTTP requests if PHP-VCR is turned on right after initializing your autoloader, before the actual class to be...
Read more >Changelog - Vcr - Relish
Add VCR::Cassette#originally_recorded_at for use when freezing time based on ... Fix FakeWeb library hook so that it records the request body when using ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m using VCR and i’m having a similar problem as described here. I’m using zeep SOAP client, with requests.Session for transport, and seems like it doesn’t intercept HTTP requests. On the other hand I’m using requests.Session() also for REST HTTP requests and it seems to intercept and record these, is there any solution?
@meetmangukiya @georgedorn @IvanMalison I had a similar issue, but with a “client” we developed internally that also uses the “requests” library. I spent a while trying to diagnose the issue to no avail. What was most frustrating is that since it is an internal client, it is used in another codebase as well and VCRpy was working great over there.
Finally, I had the idea to downgrade VCRpy in the new codebase to the same version as used in the old codebase and it worked! Here is a screenshot (below) showing a failing test b/c it bypasses VCRpy, I uninstall VCRpy==1.11.1, and re-install VCRpy==1.11.0 - then the test passes!
I tried various different configs and methods of using VCRpy (decorator vs
with
-context) all to no avail, it just wouldn’t see the http requests made by the “requests” lib inside the API client. Sorry I don’t have more help.