responses: TypeError: cannot unpack non-iterable CallbackResponse object
After upgrading from responses 0.12.0 to 0.12.1 our unit tests fail with the following error:
...
../../../../venv/lib/python3.8/site-packages/requests/sessions.py:590: in post
return self.request('POST', url, data=data, json=json, **kwargs)
../../../../venv/lib/python3.8/site-packages/requests_oauthlib/oauth2_session.py:515: in request
return super(OAuth2Session, self).request(
../../../../venv/lib/python3.8/site-packages/aws_xray_sdk/ext/requests/patch.py:27: in _xray_traced_requests
return xray_recorder.record_subsegment(
../../../../venv/lib/python3.8/site-packages/aws_xray_sdk/core/recorder.py:424: in record_subsegment
return_value = wrapped(*args, **kwargs)
../../../../venv/lib/python3.8/site-packages/requests/sessions.py:542: in request
resp = self.send(prep, **send_kwargs)
../../../../venv/lib/python3.8/site-packages/requests/sessions.py:655: in send
r = adapter.send(request, **kwargs)
../../../../venv/lib/python3.8/site-packages/responses.py:733: in unbound_on_send
return self._on_request(adapter, request, *a, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <responses.RequestsMock object at 0x104e06880>
adapter = <requests.adapters.HTTPAdapter object at 0x10a7a8a00>
request = <PreparedRequest [POST]>
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': 10, ...}
def _on_request(self, adapter, request, **kwargs):
> match, match_failed_reasons = self._find_match(request)
E TypeError: cannot unpack non-iterable CallbackResponse object
../../../../venv/lib/python3.8/site-packages/responses.py:680: TypeError
This seems to have been caused by the refactoring of the Response._find_match() method.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 8
- Comments: 19 (11 by maintainers)
Commits related to this issue
- BGDIINF_SB-1512: fixed moto dependency issue Skip the response 0.12.1 version from 12.11.2020 which has an issue. See https://github.com/getsentry/responses/issues/358 We had the folllowing error du... — committed to geoadmin/service-stac by ltshb 4 years ago
- BGDIINF_SB-1512: fixed moto dependency issue Skip the response 0.12.1 version from 12.11.2020 which has an issue. See https://github.com/getsentry/responses/issues/358 We had the folllowing error du... — committed to geoadmin/service-stac by ltshb 4 years ago
- BGDIINF_SB-1512: fixed moto dependency issue Skip the response 0.12.1 version from 12.11.2020 which has an issue. See https://github.com/getsentry/responses/issues/358 We had the folllowing error du... — committed to geoadmin/service-stac by ltshb 4 years ago
- BGDIINF_SB-1512: fixed moto dependency issue Skip the response 0.12.1 version from 12.11.2020 which has an issue. See https://github.com/getsentry/responses/issues/358 We had the folllowing error du... — committed to geoadmin/service-stac by ltshb 4 years ago
- BGDIINF_SB-1512: fixed moto dependency issue Skip the response 0.12.1 version from 12.11.2020 which has an issue. See https://github.com/getsentry/responses/issues/358 We had the folllowing error du... — committed to geoadmin/service-stac by ltshb 4 years ago
- BGDIINF_SB-1512: fixed moto dependency issue Skip the response 0.12.1 version from 12.11.2020 which has an issue. See https://github.com/getsentry/responses/issues/358 We had the folllowing error du... — committed to geoadmin/service-stac by ltshb 4 years ago
- BGDIINF_SB-1512: fixed moto dependency issue Skip the response 0.12.1 version from 12.11.2020 which has an issue. See https://github.com/getsentry/responses/issues/358 We had the folllowing error du... — committed to geoadmin/service-stac by ltshb 4 years ago
- BGDIINF_SB-1512: fixed moto dependency issue Skip the response 0.12.1 version from 12.11.2020 which has an issue. See https://github.com/getsentry/responses/issues/358 We had the folllowing error du... — committed to geoadmin/service-stac by ltshb 4 years ago
@hramezani I’ve also tried to create a minimal example for you. It passes on my machine when I use responses version 0.12.0 and fails when I upgrade to 0.12.1:
I created a PR(https://github.com/getsentry/responses/pull/359) to address this problem.
We have the same issue with a slightly different error message.
Why is
motomocking internals ofresponses?We’re skipping the 0.12.1 version for now:
responses>=0.9.0,!=0.12.1in the requirements.Hi @hramezani Here is a simplified Version of the test that is failing for us.
Further I found out that our test works with moto==1.3.14 but fails with moto=1.3.16.