Comparison
httpretty vs mocket vs requests-mock vs responses
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
HTTP client mock for Python
Low maintenance activity. Last release over 5 years ago, commits in 1 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install httprettySocket Mock Framework - for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support
Actively maintained. Last release 4 weeks ago, commits in 8 of the last 26 weeks. A safe choice.
pip install mocketMock out responses from the requests package
Slowing down. Last release over 2 years ago, little activity since. Fine for existing code; think twice for a new project.
pip install requests-mockA utility library for mocking out the `requests` Python library.
Actively maintained. Last release 3 months ago, commits in 14 of the last 26 weeks. A safe choice.
pip install responsesIn short
- requests-mock is slowing down (last release over 2 years ago): fine for existing code, risky for a new project.
- responses is the most used: 71.6M downloads a month, 3.7× more than requests-mock.
- Maintenance is comparable: mocket 78, responses 78, httpretty 14 on Pythie’s Index.
- responses is growing fastest: downloads +15% over the last month.
- Safe default for a new project: responses.
Side by side
| Metric | httpretty | mocket | requests-mock | responses |
|---|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 14 | 78 |