pytest-recording
A pytest plugin powered by VCR.py to record and replay HTTP traffic
Decision gist · record as of 2026-08-14
Yes. This is a well-maintained, actively developed plugin with no security issues, low install friction, and a clear use case for any project testing code that makes HTTP requests. The permissive MIT license poses no barrier. Install it if you want to replace live API calls or manual mocks with recorded cassettes in pytest.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires pytest and vcrpy as runtime dependencies.
- Default recording mode is 'none' to prevent unintentional network requests; you must pass --record-mode=once (or another mode) to pytest to allow recording on first run.
- Low friction install with just two runtime dependencies (pytest and vcrpy).
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use this in commercial projects with minimal restrictions.
last release 2025-05-08 (463 days) · last repo commit 2026-07-20 · 615 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 6,134,948 downloads/mo, #1,966 on PyPI
Alternatives
Verify before relying
pip install pytest-recording
import pytest
@pytest.mark.vcr
def test_api_call():
# Your test code that uses pytest and vcrpy
pass
# Run with: pytest --record-mode=once test_file.py- Whether the plugin works with pytest fixtures beyond vcr_config and the vcr cassette object itself
- Performance characteristics when replaying large cassette files or many simultaneous tests
- Exact HTTP status codes or response assertions supported in decorated test functions
What it is and what it does
pytest-recording is a pytest plugin that integrates vcrpy to record HTTP interactions during test runs and replay them on subsequent runs. Instead of mocking HTTP responses manually or hitting live APIs in tests, you decorate test functions with @pytest.mark.vcr and the plugin automatically captures requests and responses into YAML cassette files, then replays them without network access. This makes tests faster, more reliable, and independent of external services.
The plugin offers straightforward configuration through pytest marks and fixtures, supports combining multiple cassettes, can block network access entirely to prevent accidental live requests, and includes a rewrite mode to regenerate cassettes from scratch. It integrates with vcrpy's full API, allowing custom matchers, persisters, and fine-grained control over what gets recorded and filtered.
Use it for
- Test code that calls external APIs without making real network requests during CI/CD runs
- Record API responses once, then run tests offline or in isolated environments
- Prevent tests from failing due to external service downtime or rate limiting
- Block network access globally to catch unintended HTTP calls in your test suite
- Filter sensitive headers or query parameters from cassettes before committing them to version control
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
This is a well-maintained, actively developed plugin with no security issues, low install friction, and a clear use case for any project testing code that makes HTTP requests. The permissive MIT license poses no barrier. Install it if you want to replace live API calls or manual mocks with recorded cassettes in pytest.
Install
pytest-recording on PyPI
Before you install
Low friction install with just two runtime dependencies (pytest and vcrpy). Actively maintained with recent commits and no known vulnerabilities. Supports Python 3.9 through 3.13.
Requires pytest and vcrpy as runtime dependencies. Default recording mode is 'none' to prevent unintentional network requests; you must pass --record-mode=once (or another mode) to pytest to allow recording on first run.
License in practice
MIT license is permissive; you can use this in commercial projects with minimal restrictions.
Quickstart
pip install pytest-recording
import pytest
@pytest.mark.vcr
def test_api_call():
# Your test code that uses pytest and vcrpy
pass
# Run with: pytest --record-mode=once test_file.py
Verify before relying
- Whether the plugin works with pytest fixtures beyond vcr_config and the vcr cassette object itself
- Performance characteristics when replaying large cassette files or many simultaneous tests
- Exact HTTP status codes or response assertions supported in decorated test functions
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagespytestvcrpy |
| Maintenance | Actively maintained 463 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,134,948 / month, #1,966 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: TestingTyping :: Typed |
Evidence: pytest_recording-0.13.4-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “pytest http mocking vcr”
- pytest-recordingA pytest plugin that records and replays HTTP traffic using VCR.py,…
- pytest-vcrA pytest plugin that integrates VCR.py to record and replay HTTP…
- vcrpy-unittestProvides a unittest base class that automatically records and replays…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also pytest-vcr · betamax · keboola.vcr · vcrpy · vcrpy-unittest · pytest-httpbin · pytest-logger · pytest-responses · pytest-mock · mocket