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'
vcr.use_cassette(path...)is due to the cassette file being 70 MB
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').
urlopen error [Errno 61] Connection refusedexceptions in py2 while py3 correctly replays the cassette (I did generate the cassette in py3 if that matters). The project is using urllib, and future was added to support py2/3 compatibility. It seems like in py2 vcr isn't wrapping/patching correctly. Anyone have experience with that or suggestions on how to deal with that? I am basically using defaults for everything here. Here is an extraction of the code (not from the test itself) that throws the exception (trimmed for brevity and relevance):
from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import object from future import standard_library standard_library.install_aliases() import urllib.request request = urllib.request.Request(uri, post_data, headers) response = urllib.request.urlopen(request)