Skip to content

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

@davidwtbuxton

Description

@davidwtbuxton

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions