HTTPretty vs responses

Python HTTP testing libraries compared

HTTPretty and responses replace real HTTP responses with fakes so Python tests can exercise HTTP-dependent code without relying on live services. HTTPretty intercepts traffic at the socket level, while responses targets calls made with the `requests` library and offers detailed request matching and response management.

HTTPrettyresponses
LanguagePythonPython
LicenseMITApache-2.0
Stars2.1k4.3k
Forks285386
Last analyzedOct 3, 2026Oct 3, 2026

Key differences

  • HTTPretty intercepts Python HTTP traffic at the socket level; responses intercepts calls made with `requests`.
  • HTTPretty can capture requests for body and count inspection; responses records calls and supports assertions about call counts.
  • responses offers matchers for request data and headers, callbacks, passthrough rules, and beta response recording and replay; HTTPretty lists registered fakes, repeated responses, and disabling network connections.
  • HTTPretty lists Python 3.6 through 3.9 as supported; responses requires Python 3.8 or newer and `requests` 2.30.0 or newer, according to their READMEs.
  • HTTPretty uses the MIT license; responses uses Apache-2.0.
  • HTTPretty has 2.1k stars and 285 forks; responses has 4.3k stars and 386 forks.

Choose HTTPretty if you…

  • need socket-level interception for Python HTTP traffic.
  • want to test code using HTTP clients beyond `requests`.
  • need to inspect captured request bodies or test multiple responses to the same URL.
Read the HTTPretty analysis →

Choose responses if you…

  • use `requests` and want to match request data, headers, or selected arguments.
  • need callbacks or ordered response sequences to model changing server behavior.
  • want to inspect recorded calls, configure passthrough rules, or try beta response recording and replay.
Read the responses analysis →

Compare the numbers side by side, or add more projects

This comparison is generated with AI from the OSRepos analyses of both projects. Always check each project's repository and documentation before choosing.