Our take
Inactiveno commits in over a year- Activity
- 20
- Community
- 61
- Issues
- 21
- Pull requests
- 21
-2 stars in the last 29 days
HTTPretty offers a focused way to mock HTTP traffic in Python tests, but its inactive status makes current compatibility and maintenance worth checking before adopting it.
Good fit if
- Your tests need to intercept HTTP requests through Python's socket layer and inspect the captured traffic.
- You want to return controlled responses, including different statuses, without making live API calls.
- An MIT-licensed Python dependency suits your project.
Look elsewhere if
- You need a project with recent commits or releases: the repository has had no commits or releases in over a year.
- You need evidence of active issue or pull-request handling: none were closed or merged in the recent measurement period.
- Your Python version is outside the versions listed in the README and you require documented support.
All health signals
| Last commit | 2024-06-09 (2.4 years ago) |
|---|---|
| Commits, last 90 days | 0 |
| Releases, last 12 months | 0 |
| Contributors | 79 (top contributor: 73% of commits) |
| Issues closed, last 90 days | 0 |
| Pull requests merged, last 90 days | 0 |
| Project age | 15 years |
Checked on 2026-10-26 with the GitHub API.
Project history
Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.
Stars
2,147Forks
285Change since Nov 4, 2026: 0 stars·0 forks
Overview
HTTPretty is a Python HTTP client mocking tool built around a fake TCP socket module. It intercepts HTTP requests at the socket level, letting tests substitute controlled responses for real network calls and inspect the requests made by the code under test.
It is intended for Python developers testing API integrations, especially when tests should not depend on external services. The README lists Python 3.6 through 3.9 as supported versions and describes inspiration from FakeWeb.
Key Features
- Intercepts HTTP requests at the Python socket level.
- Registers fake responses by HTTP method and URL.
- Supports multiple registered responses for a URL, including different status codes.
- Captures requests for inspection, including their bodies.
- Can disallow live network connections while a test is active.
- Provides an activation decorator for scoping the mock to a test.
Use Cases
- API integration developers can test client behavior against deterministic responses instead of calling a live service.
- Test authors can verify that code sends the expected method, URL, and request body.
- Teams can exercise error handling by registering responses with failure status codes.
- Developers using test-driven development can record and replay HTTP interactions while iterating on API-related code.
What you need
Detected in the repository
- Python (from setup.py)
- A test suite and automated checks on GitHub Actions
License in plain words
MITpermissive
- Commercial use: yes
- Modify and redistribute: yes
- You must keep: the copyright and license notice
- Share your changes: no
A summary, not legal advice: the LICENSE file is what applies.
Getting Started
Install from PyPI:
pip install httpretty
See the README and documentation for usage details.
Alternatives
- httmock: httmock targets HTTP calls made through requests with conditional or catch-all responses, while HTTPretty intercepts traffic using a fake TCP socket.
- python-mocket: Mocket intercepts socket and SSL traffic across HTTP and other protocols, while HTTPretty focuses on mocking HTTP through a fake TCP socket.
- responses: Responses intercepts calls specifically from the Requests library, while HTTPretty works at the socket level for broader HTTP client coverage.
- vcrpy: VCR.py records and replays HTTP interactions from cassette files, while HTTPretty lets tests define mocked responses and inspect captured requests.
| Project | Language | License | Stars | Status |
|---|---|---|---|---|
| HTTPretty | Python | MIT | 2.1k | Inactive |
| httmock | Python | – | 471 | Inactive |
| python-mocket | Python | BSD-3-Clause | 311 | Active |
| responses | Python | Apache-2.0 | 4.3k | Active |
| vcrpy | Python | MIT | 3k | Quiet |
Considerations
The repository is marked inactive, with no commits in over a year and no releases in the past year. Although the project has contributions from many people, recent activity measures show no issue closures or merged pull requests, so teams should verify compatibility with their Python and HTTP-client versions themselves. The README lists Python 3.6 through 3.9, which may not establish support for newer runtimes. The project uses the MIT license; review its terms for your distribution and use.
Found this useful?
Share it with someone who would like HTTPretty.