0.17.0 blocks moto and httpretty interop
See original GitHub issueWe have tests that utilize httpretty and moto but the 0.17.0 update causes the following error:
requests.exceptions.ConnectionError: Connection refused by Responses - the call doesn’t match any registered mock.
This is true because our internal calls are not an AWS destination and are mocked by httpretty.
Pinning back to 0.16.0 resolved the issue
File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.6/site-packages/responses/__init__.py", line 842, in unbound_on_send
return self._on_request(adapter, request, *a, **kwargs)
File "/usr/local/lib/python3.6/site-packages/responses/__init__.py", line 821, in _on_request
raise response
requests.exceptions.ConnectionError: Connection refused by Responses - the call doesn't match any registered mock.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:11 (5 by maintainers)
Top Results From Across the Web
HTTPretty's - HTTP Client Mocking for Python — HTTPretty 1.1 ...
https://github.com/gabrielfalcao/HTTPretty/raw/master/. HTTP Client mocking tool for Python created by Gabriel Falcão . It provides a full fake TCP socket ...
Read more >main - Anaconda repo
Package Latest Version Doc Dev License linux‑64 osx‑64 win‑64
7za 920 doc LGPL X
7zip 19.00 dev LGPL‑2.1‑or‑later X
_anaconda_depends 2022.05 doc dev BSD X X...
Read more >Cron <root@ppc-hub> /usr/local/bin/do-compare.sh
... only remote: eclipse-m2e-mavenarchiver-0.17.0-0.3.git0a4e929.fc24 ... only remote: libopensync-plugin-moto-0.22-13.fc24 only remote: ...
Read more >Sync-friendly git mirror of repo/gentoo with caches and metadata
... defining the SPICE protocol app-emulation/spice-vdagent 0.17.0: SPICE VD ... deleted files in block devices app-forensics/memdump 1.01: Simple memory ...
Read more >Package list with short descriptions
2048-cli-0.9.1 terminal version of the 2048 sliding block puzzle game. 2bwm-0.3 fast floating window manager ... coldfire-0.3.1p2 Motorola Coldfire emulator.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@davetrollope Moto has just released a new version, 2.3.2.dev2, that works with all versions of
responses
. If you do run into any other issues with the latest version, feel free to raise them in Moto’s repo: https://github.com/spulec/moto/issues/4750@beliaev-maksim Appreciate the offer! Looks like everything is sorted now. With 0.17.0, we no longer have to touch any of the internal API’s, so that always a good sign 🙂
On a janitorial note: It looks like
ResponsesMock._matches
is no longer used anywhere: https://github.com/getsentry/responses/blob/6e7d4669c1a0bb236747111fc8e9502c281d7fcf/responses/__init__.py#L524 If you want, I can raise a PR to remove this field?Moto maintainer here - yes, we do. This was our setup in 0.16:
A reproducible usecase using Moto would be:
So the first request (hiding behind
conn.create_queue()
would be intercepted byresponses
, because our decorator has created a mock for it, but the second request should go through.