Agent skill · software engineering · aiskillstore

pytest-recording

Work with pytest-recording (VCR.py) for recording and replaying HTTP interactions in tests. Use when writing VCR tests, managing cassettes, configuring VCR options, filtering sensitive data, or debugging recorded HTTP responses.

Why this skill is useful

Provides specific commands and configurations for managing VCR tests with pytest that the AI wouldn't reliably generate on its own.

What it needs

Requires pytest, vcrpy installed locally. About 3k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

pytest-recording (VCR.py) Testing Overview pytest-recording wraps VCR.py to record HTTP interactions as YAML cassettes, enabling deterministic tests without live API calls. Quick Reference Running Tests Recording Modes Mode Flag Behavior ------ ------ ---------- none --vcr-record=none Only replay, fail if no cassette once (default) Record if no cassette exists newepisodes --vcr-record=newepisodes Record new requests, keep existing all --vcr-record=all Always record, overwrite existing rewrite --vcr-record=rewrite Delete and re-record all cassettes Writing VCR Tests Basic test with VCR: Custom cassette name: Multiple cassettes: VCR Configuration in conftest.py The vcrconfig fixture controls VCR behavior: Filtering Sensitive Data For LLM providers, filter authentication: Response Processing Use pytestrecordingconfigure for advanced processing: Cassette Location Cassettes are stored in tests/cassettes/ by default, organized by test module: Debugging Cassette Not Found If tests fail with "Can't find cassette": 1. Run with --vcr-record=once to create missing cassettes 2. Check cassette path matches test location 3. Verify cassette file exists and is valid YAML Request Mismatch If VCR can't match requests: 1. Check matchon criteria in vcrconfig 2. Compare request details in cassette vs actual request 3. Use --vcr-record=newepisodes to add missing interactions Stale Cassettes When API responses change: 1. Delete specific cassette file and re-run test 2. Or use --vcr-record=rewrite to refresh all cassettes View Cassette Contents Adding New LLM Providers When adding a new provider: 1. Identify authentication headers (check provider docs) 2. Add headers to filterheaders in vcrconfig 3. Add any query param auth to filterqueryparameters 4. Test with --vcr-record=once to create cassettes 5. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/pytest-recording

View the source on GitHub

Browse the @skills marketplace