tests: Replace httpretty with responses.

responses is an module analogous to httpretty for mocking external
URLs, with a very similar interface (potentially cleaner in that it
makes use of context managers).

The most important (in the moment) problem with httpretty is that it
breaks the ability to use redis in parts of code where httpretty is
enabled.  From more research, the module in general has tendency to
have various troublesome bugs with breaking URLs that it shouldn't be
affecting, caused by it working at the socket interface layer.  While
those issues could be fixed, responses seems to be less buggy (based
on both third-party reports like ckan/ckan#4755 and our own experience
in removing workarounds for bugs in httpretty) and is more actively
maintained.
This commit is contained in:
Mateusz Mandera
2020-01-22 17:41:49 +01:00
committed by Tim Abbott
parent 445a11753b
commit 8dd95bd057
6 changed files with 133 additions and 161 deletions

View File

@@ -20,7 +20,7 @@ coverage
https://github.com/zulip/fakeldap/archive/ff32deaad34b91d5ba5735f314362c0456c92607.zip#egg=fakeldap==0.6.1zulip
# For testing mock http requests
httpretty
responses
# For sorting imports
isort