Our take
- Activity
- 38
- Community
- 89
- Issues
- 47
- Pull requests
- 21
+4 stars in the last 29 days
- More contributors than 78% of the projects we track
Project history
Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.
Stars
3,022Forks
448Change since Nov 4, 2026: 0 stars·+2 forks
Overview
VCR.py is a Python library for recording HTTP requests and responses during tests, then replaying them from cassette files on later runs. This avoids repeated network traffic and makes tests that depend on HTTP services faster and more predictable.
It suits teams testing code that makes HTTP requests through libraries supported by VCR.py. The first run needs to reach the service to record interactions; subsequent runs can use the saved cassette data instead.
Key Features
- Records HTTP interactions made within a VCR.py context or decorated function.
- Serializes interactions to cassette files, using YAML by default.
- Intercepts requests that match recorded interactions and returns their saved responses.
- Lets tests run without HTTP traffic after interactions have been recorded.
- Supports refreshing recorded data by removing cassette files and running the tests again.
- Can be used with pytest through the separate pytest-recording library.
Use Cases
- Python developers can test HTTP client code without contacting remote services on every test run.
- Teams can make tests that depend on external APIs more deterministic when the recorded interactions remain suitable.
- Developers can run tests offline after recording the required interactions.
- Maintainers can update test fixtures after an API changes by recording a new set of interactions.
Getting Started
Read the repository README and documentation for setup and usage details. For pytest fixtures, see pytest-recording.
Alternatives
- python-mocket: Mocket intercepts socket and SSL traffic for configurable mocks, while vcrpy records HTTP exchanges to cassettes for later replay.
- responses: Responses mocks Python Requests calls with registered responses and assertions, rather than recording and replaying cassette files.
- httmock: httmock replaces matching requests calls with configured responses, rather than recording live interactions for cassette replay.
- HTTPretty: HTTPretty intercepts HTTP traffic at the socket level and can capture or replay it, while vcrpy uses cassette-based recording and matching.
| Project | Language | License | Stars | Status |
|---|---|---|---|---|
| vcrpy | Python | MIT | 3k | Not checked yet |
| python-mocket | Python | BSD-3-Clause | 311 | Active |
| responses | Python | Apache-2.0 | 4.3k | Active |
| httmock | Python | – | 471 | Inactive |
| HTTPretty | Python | MIT | 2.1k | Inactive |
Considerations
- The initial recording run makes real HTTP requests, so the service must be reachable and the test environment must be able to access it.
- Replay depends on requests matching interactions stored in cassette files. Changes to an API or to the requests made by the test may require re-recording.
- VCR.py records traffic through the libraries it supports; check the documentation for details about compatibility and configuration.
Found this useful?
Share it with someone who would like vcrpy.