Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Kevin McCarthy
@kevin1024
@IvanMalison @agriffis you guys are the best. The documentation is looking fantastic!
Steve Adams
@stevezau
hey all.. VCR does not work with python-future.org
as it replaced urllib2 on py2 with future.backports.urllib.request
Steve Adams
@stevezau
i want to create a PR but i can't find where vcrpy patches urllib2?
Steve Adams
@stevezau
hmm
had to do that for now
Patchett
@Patchett
Hi
I am trying to run a sample vcr test case at the python cli
I have the package installed
i type the following commands at the terminal..
python
@vcr.use_cassette()
... def test_iana():
... response = urllib2.urlopen('http://www.iana.org/domains/reserved').read()
... assert 'Example domains' in response
... print "test"
test
but no yaml file or anything shows up anywhere
Владимир
@VovanOfficial_twitter
Hello! Can someone advise me how to work with multiple requests - for example i have a method that make two requests, does vcr supports writitng couple of requests in one file?
with vcr.use_cassette('fixtures/vcr_cassettes/synopsis.yaml'):
data = method_that_makes_couple_of_requests()
self.assertEqual(data,'expected_result')
With code write like this it's seems that vcr record only one request
Can some one advise a way to work with couple requests at once with vcr?
Владимир
@VovanOfficial_twitter
Solve this - vcr doesnt save multiple requests if they work assync - in this situation only one of them is saved
Thomas Grainger
@graingert
Yo
Kenneth Reitz
@kennethreitz
yo!
@kevin1024
Meet Mangukiya
@meetmangukiya
I am looking for a way to use a cassetted response to instantiate a github3 object in the setUp method of testCase and then use it
I tried
class Github(unittest.TestCase):
    @vcr.use_cassette('github.yaml')
    def setUp(self):
        self.gh = github3.GitHub(token=os.environ.get('GH_TOKEN', ''))

    @vcr.use_cassette('test_organization.yaml')
    def test_organizatiton(self):
        assert self.gh.organization('coala').name == 'name'
but it seems that self.gh turns out as a NoneType object
when called the test suite without the env var
Meet Mangukiya
@meetmangukiya
I think vcr doesn't hijeck requests session of github3 ?
Liam
@liamhession
Does anyone know if there is a practical limit to the size of cassettes?
I'm trying to determine if the extremely slow loading time on my call to vcr.use_cassette(path...) is due to the cassette file being 70 MB
Or maybe i have some other problem
Liam
@liamhession
@graingert do you have any idea about cassette size limits? Have not found anything in the docs
Thomas Grainger
@graingert
liamhession: probably about 4GiB
liamhession: depends on your filesystem thoug
liamhession: I'm going to point my finger at yaml
or pyaml
liamhession: and it's going to continue pointing in that vague direction until you can prove it's not them ;)
Liam
@liamhession
Yeah, would those be the slowest portion?
Thomas Grainger
@graingert
🤷
they've got to parse the damn thing
Liam
@liamhession
That is where the code seemed to be whenever I Ctrl-C'd the slow-loading attempts to use a cassette
Thomas Grainger
@graingert
liamhession: how did it blow up to that size?
Liam
@liamhession
Requests with large responses. This is for a scraper of restaurant menu information
Thomas Grainger
@graingert
liamhession: don't test at that level then
liamhession: pyvcr is a cruise missile for http tests
liamhession: you should create a function that parses the bit you want out of some web content
then test assert parses_the_bit_you_want_out_of_some_web_content(some_web_content) == the_bit_you_want
liamhession: it's always best to separate all of your IO code from the rest of your code
Liam
@liamhession
Thanks for the responses, @graingert. I'll have to tweak how i'm using vcr definitely
Meet Mangukiya
@meetmangukiya
even though a request is recorded, it says it isn't recorded and raises cannot overwrite error
Error:
vcr.errors.CannotOverwriteExistingCassetteException: No match for the request (<Request (GET) http://webservices.coala.io/list/bears>) was found. Can't overwrite existing cassette ('tests/cassettes/coatils_list_bears.yaml') in your current record mode ('once').
one can see it is the first interaction
what is the problem here :/