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

Tests fail in master with aiohttp==3.7.0, "TypeError" #173

Closed
davidwtbuxton opened this issue Oct 24, 2020 · 1 comment · Fixed by #174
Closed

Tests fail in master with aiohttp==3.7.0, "TypeError" #173

davidwtbuxton opened this issue Oct 24, 2020 · 1 comment · Fixed by #174

Comments

@davidwtbuxton
Copy link
Contributor

Running tests for the current head of master gives me

Ran 55 tests in 0.709s

FAILED (errors=30)
  • aioresponses commit e61977f
  • aiohttp==3.7.0
  • Python 3.8.6 on Mac OS X 10.14.6

All the failing tests have a traceback similar to the following:

======================================================================
ERROR: test_streaming_up_to (tests.test_aioresponses.AIOResponsesTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/unittest/async_case.py", line 65, in _callTestMethod
    self._callMaybeAsync(method)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/unittest/async_case.py", line 88, in _callMaybeAsync
    return self._asyncioTestLoop.run_until_complete(fut)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/unittest/async_case.py", line 102, in _asyncioLoopRunner
    ret = await awaitable
  File "/aioresponses/aioresponses/core.py", line 243, in wrapped
    return await f(*args, **kwargs)
  File "/aioresponses/tests/test_aioresponses.py", line 167, in test_streaming_up_to
    resp = await self.session.get(self.url)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/unittest/mock.py", line 2136, in _execute_mock_call
    result = await effect(*args, **kwargs)
  File "/aioresponses/aioresponses/core.py", line 390, in _request_mock
    response = await self.match(method, url, **kwargs)
  File "/aioresponses/aioresponses/core.py", line 337, in match
    response_or_exc = await matcher.build_response(
  File "/aioresponses/aioresponses/core.py", line 192, in build_response
    resp = self._build_response(
  File "/aioresponses/aioresponses/core.py", line 173, in _build_response
    resp.content = stream_reader_factory(loop)
  File "/aioresponses/aioresponses/compat.py", line 48, in stream_reader_factory
    return StreamReader(protocol, loop=loop)
TypeError: __init__() missing 1 required positional argument: 'limit'

The new version 3.7.0 of aiohttp has changed the signature for the StreamReader class, making the limit argument required.

https://github.com/aio-libs/aiohttp/blob/56e78836aa7c67292ace9e256711699d51d57285/aiohttp/streams.py#L106

tseaver added a commit to googleapis/google-auth-library-python that referenced this issue Oct 26, 2020
Working around breaking change in 3.7.0.  See:

pnuckowski/aioresponses#173
gcf-merge-on-green bot pushed a commit to googleapis/google-auth-library-python that referenced this issue Oct 27, 2020
Working around breaking change in 3.7.0.  See:

pnuckowski/aioresponses#173
@bentlusty
Copy link

Hey, when will this patch be merged?

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

Successfully merging a pull request may close this issue.

2 participants