Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aiohttp ClientResponse signature has changed #348

Closed
chrisimcevoy opened this issue Mar 26, 2018 · 0 comments
Closed

aiohttp ClientResponse signature has changed #348

chrisimcevoy opened this issue Mar 26, 2018 · 0 comments

Comments

@chrisimcevoy
Copy link

Hi! Firstly, a quick thank you for this library.

I've hit an issue with the aiohttp stubs, following this aiohttp commit which changes the signature of their ClientResponse class.

This breaks lines 56 and 66 in aiohttp_stubs\.__init__.py:

response = MockClientResponse(method, URL(vcr_response.get('url')))

I only started using vcrpy today, so naturally I assumed I was doing something wrong when I consistently got the following Exception on cassette playback:

File "C:\Users\chris.mcevoy\Documents\GitHub\{private repo}\env\lib\site-packages\vcr\stubs\aiohttp_stubs\__init__.py", line 57, in new_request response = MockClientResponse(method, URL(url)) TypeError: __init__() missing 8 required keyword-only arguments: 'writer', 'continue100', 'timer', 'request_info', 'auto_decompress', 'traces', 'loop', and 'session'

For the most part, I think this could be relatively easily worked around by giving vcrpy's MockClientResponse an __init__() which calls super().__init__() with the old defaults...?

However, there are two new args in aiohttp ClientResponse's signature to consider, specifically loop and session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant