responses vs vcrpy
Python HTTP testing: registered mocks or recorded replays
responses and vcrpy both help Python developers test code that makes HTTP requests without relying on live services on every test run. responses serves registered mock responses, while vcrpy records real interactions to cassette files and replays them later.

responses: Mock Python Requests in Tests
Responses intercepts Python Requests calls and serves registered mock responses, so tests can exercise HTTP client code without contacting real services. It supports request matching, callbacks, call assertions, and ordered response sequences.

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.
| responses | vcrpy | |
|---|---|---|
| Language | Python | Python |
| License | Apache-2.0 | MIT |
| Stars | 4.3k | 3k |
| Forks | 386 | 444 |
| Last analyzed | Oct 3, 2026 | Oct 3, 2026 |
Key differences
- responses targets the Python requests library; vcrpy supports HTTP traffic through libraries it supports, with compatibility details in its documentation.
- responses uses registered responses, matchers, callbacks, and optional ordered sequences; vcrpy replays interactions saved in cassette files.
- responses can test immediately with configured mocks; vcrpy needs an initial run that reaches the service to record interactions before offline replay.
- responses lists Apache-2.0 licensing, while vcrpy lists MIT licensing.
- responses supports passthrough rules and call-count assertions; vcrpy emphasizes refreshing recorded fixtures by removing cassette files and recording again.
Choose responses if you…
- need to define expected status codes, headers, bodies, or request data directly in tests.
- want callbacks or ordered responses to model changing server behavior.
- need call history, call-count assertions, or rules for allowing selected requests through.
Choose vcrpy if you…
- want to capture real HTTP interactions and replay them from YAML-default cassette files.
- need tests to run offline after the required interactions have been recorded.
- prefer updating test fixtures by recording interactions again after API changes.
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.