HTTPretty vs vcrpy
Python HTTP testing tools compared
HTTPretty and vcrpy help Python developers test code that makes HTTP requests without relying on live services for every test. HTTPretty registers fake responses directly, while vcrpy records real interactions to cassette files and replays them later.

HTTPretty: Mock HTTP Requests in Python Tests
HTTPretty intercepts Python HTTP traffic at the socket level and returns registered fake responses. It helps developers test API integrations without relying on live services, and can capture requests for assertions or playback.

vcrpy: Replay HTTP Interactions in Tests
VCR.py records HTTP interactions to cassette files and replays matching responses in later test runs. It helps Python developers make network-dependent tests faster, deterministic, and usable offline after recording.
| HTTPretty | vcrpy | |
|---|---|---|
| Language | Python | Python |
| License | MIT | MIT |
| Stars | 2.1k | 3k |
| Forks | 285 | 444 |
| Last analyzed | Oct 3, 2026 | Oct 3, 2026 |
Key differences
- HTTPretty intercepts traffic at the socket level and returns responses registered for HTTP methods and URLs; vcrpy records and replays matching interactions from cassette files.
- HTTPretty can capture requests for assertions and register successive responses for repeated requests; vcrpy can refresh recorded interactions by removing cassette files and recording again.
- HTTPretty can disable network connections during a test; vcrpy needs a reachable service for the initial recording run, then can replay interactions offline.
- HTTPretty lists Python 3.6 through 3.9 as supported; vcrpy advises checking its documentation for supported libraries and configuration.
- Both projects use Python and the MIT license. HTTPretty has 2.1k stars and 285 forks, while vcrpy has 3k stars and 444 forks.
Choose HTTPretty if you…
- need to register predictable responses for specific methods and URLs.
- want to inspect captured request bodies or counts in tests.
- need to test successive responses without recording a live interaction first.
Choose vcrpy if you…
- want to save HTTP interactions to cassette files and replay them in later test runs.
- need tests to run offline after recording the required interactions.
- want to refresh recorded fixtures by removing cassettes and running tests again.
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.