Skip to main content
python/evalvcr implements the exact evalvcr.cassette.v1 and evalvcr.report.v1 JSON schemas using Python >= 3.10 standard library only (pytest is optional).

Install

Using with pytest

evalvcr registers a pytest11 entry point exposing:
  • CLI options: --evalvcr-mode (default replay) and --evalvcr-cassette-dir (default .evalvcr/cassettes)
  • Marker: @pytest.mark.evalvcr(cassette="my-case") (omit mode so CLI flags control auto locally vs strict in CI)
  • Fixture: evalvcr_cassette (yields CassetteVCR, saves on teardown in record/auto, and runs verify_complete() in strict mode)
Record once locally and enforce strict replay in CI:

Using the Python CLI

Run define_eval(...) suites or inspect/scrub/export artifacts directly:

Cross-Language Interoperability

Because Python and TypeScript share UTF-16 code-unit JCS canonical JSON sorting, ASCII scrubbing order, and camelCase JSON fields, cassettes recorded in TypeScript replay strictly in Python and vice versa. See examples/python-pytest/test_support_agent.py for a live cross-language replay test.