vcrpy-unittest
Python unittest integration for vcr.py
What it is and what it does
vcrpy-unittest bridges vcrpy and Python's unittest framework by providing VCRTestCase, a base class that automatically handles HTTP cassette recording and playback. Instead of manually wrapping test methods with VCR context managers, you inherit from VCRTestCase and write normal unittest code; the class intercepts HTTP calls, records them to YAML files on first run, and replays them on subsequent runs. It also exposes the cassette object as self.cassette so you can make assertions about recorded interactions.
The package is lightweight—it depends only on vcrpy—and offers customization hooks (_get_vcr_kwargs, _get_cassette_library_dir, _get_cassette_name, _get_vcr) to control cassette location, naming, and VCR configuration. A VCRMixin variant is available for cases where inheriting from VCRTestCase conflicts with existing class hierarchies.
Use it for:
- Write integration tests that record live HTTP interactions on first run, then replay recorded responses in CI/CD pipelines without network access.
- Test code that depends on external APIs by recording interactions once, then running tests offline with deterministic responses.
- Verify HTTP request details by inspecting self.cassette.requests and self.cassette after a test executes.
- Add custom VCR matchers to control how recorded requests are matched during playback.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a unittest base class that automatically records and replays HTTP interactions using vcrpy, eliminating manual cassette management in test code.
No. The package is abandoned (last release 2018-09-25, repository archived) with no activity for over 2880 days. Compatibility with modern Python versions and current vcrpy releases is unverified. While the concept is sound and the MIT license is permissive, the lack of maintenance creates risk for new projects. Consider using vcrpy directly with unittest, or evaluate actively maintained alternatives.
Install
vcrpy-unittest on PyPI
pip
pip install vcrpy-unittestuv
uv add vcrpy-unittestpoetry
poetry add vcrpy-unittestInstalling vcrpy-unittest
Before you install
Low install friction with a single runtime dependency on vcrpy. However, the package is abandoned—last release was 2018-09-25 and the repository was archived. No updates have been made in over 2880 days, so compatibility with modern Python or vcrpy versions is uncertain.
License in practice
MIT license is permissive and imposes no significant restrictions on use, modification, or distribution. Suitable for both open-source and proprietary projects.
Quickstart
pip install vcrpy-unittest
from vcr_unittest import VCRTestCase
class MyTestCase(VCRTestCase):
def test_something(self):
self.assertEqual(len(self.cassette), 1)
Requires vcrpy as a runtime dependency; cassettes are stored in a 'cassettes' subdirectory by default relative to the test file.
Verify before relying
- Compatibility with current vcrpy versions and modern Python releases (last tested with Python 3.7)
- Whether the package works with unittest features added after 2018
- Active maintenance status or community forks that may have continued development
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — vcrpy |
| Maintenance | abandoned — 2,880 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 87,842/month — #13,765 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: vcrpy_unittest-0.1.7-py2.py3-none-any.whl
Keywords: vcrpy, vcr.py, unittest, testing, mock, http
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
vcrpyVCR.py records HTTP interactions during test…
permissive · top 1,000 on PyPI
pytest-vcrA pytest plugin that integrates VCR.py to…
permissive · top 5,000 on PyPI
pytest-recordingA pytest plugin that records and replays HTTP…
permissive · top 5,000 on PyPI
keboola.vcrRecords, sanitizes, and validates HTTP…
permissive · top 15,000 on PyPI
unittest2Backports unittest features from Python 2.7 and…
permissive · top 5,000 on PyPI
parametrizeProvides a `@parametrize` decorator that works…
permissive · top 15,000 on PyPI
betamaxBetamax records and replays HTTP interactions…
permissive · top 15,000 on PyPI
pytest-httpbinProvides a pytest fixture that runs a local…
permissive · top 15,000 on PyPI
assertsProvides stand-alone assertion functions for…
unclear · top 15,000 on PyPI
easypostPython client library for the EasyPost shipping…
permissive · top 15,000 on PyPI