testing-skill
/testing-skill
Record, rewrite, and debug VCR cassettes for HTTP recordings. Use when running tests with --record-mode, verifying cassette playback, or inspecting request/response bodies in YAML cassettes.
- Author
- pydantic ↗
- Repository
- pydantic-ai ↗
- Licence
- MIT
- Last repository change
- 27.10.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 1
- HTML comments
- 0
- URLs in SKILL.md
- 1
No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 1 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: parse_cassette.py
What it does and when to use it
Record, rewrite, and debug VCR cassettes for HTTP recordings. Use when running tests with --record-mode, verifying cassette playback, or inspecting request/response bodies in YAML cassettes.
Original author description
Record, rewrite, and debug VCR cassettes for HTTP recordings. Use when running tests with --record-mode, verifying cassette playback, or inspecting request/response bodies in YAML cassettes.
How it works
- Prerequisites
- Important flags
- Recording Cassettes
- Parsing Cassettes
- Full Workflow Example
SKILL.md preview
--- name: testing-skill description: Record, rewrite, and debug VCR cassettes for HTTP recordings. Use when running tests with --record-mode, verifying cassette playback, or inspecting request/response bodies in YAML cassettes. allowed-tools: Bash(uv run pytest *), Bash(uv run python .claude/skills/testing-skill/parse_cassette.py *), Bash(source .env && uv run pytest *), Bash(git diff *) --- # Pytest VCR Workflow Use this skill when recording or re-recording VCR cassettes for tests, or when debugging cassette contents. ## Prerequisites - Verify `.env` exists: `test -f .env && echo 'ok' || echo 'missing'` - Missing API keys will cause clear test errors at runtime ## Important flags - `--record-mode=rewrite` : Record cassettes (works for both new and existing) - `--lf` : Run only the last failed tests - `-vv` : Verbose output - `--tb=line` : Short traceback output - `-k=""` : Run tests matching the given substring expression ## Recording Cassettes ### Step 1: Record cassettes ```bash source .env && uv run pytest path/to/test.py::test_function_name -v --tb=line --record-mode=rewrite ``` Multiple tests can be specified: ```bash source .env && uv run pytest path/to/test.py::test_one path/to/test.py::test_two -v --tb=line --record-mode=rewrite ``` ### Step 2: Verify recordings Run the same tests WITHOUT `--record-mode` to verify cassettes play back correctly: ```bash source .env && uv run pytest path/to/test.py::test_function_name -vv --tb=line ``` ### Step 3: Review snapshots If tests use [`snapshot()`](https://github.com/15r10nk/inline-snapshot) assertions: - The test run in Step 2 auto-fills snapshot content - Review the generated snapshot files to ensure they match expected output - You only review - don't manually write snapshot contents - Snapshots capture what the test actually produced, additional to explicit assertions ## Parsing Cassettes Parse VCR cassette YAML files to inspect request/response bodies without dealing with raw YAML. ### Usage ```bash uv run python .claude/skills/testing-skill/parse_cassette.py <cassette_path> [--interaction N] ``` ### Examples ```bash # Parse all interactions in a cassette uv run python .claude/skills/testing-skill/parse_cassette.py tests/models/cassettes/test_foo/test_bar.yaml # Parse only interaction 1 (0-indexed) uv run python .claude/skills/testing-skill/parse_cassette.py tests/models/cassettes/test_foo/test_bar.yaml --interaction 1 ``` ### Output For each interaction, shows: - Request: method, URI, parsed body (truncated base64) - Response: status code, parsed body (truncated base64) Base64 strings longer than 100 chars are truncated for readability. ## Full Workflow Example ```bash # 1. Record cassette source .env && uv run pytest tests/models/test_openai.py::test_chat_completion -v --tb=line --record-mode=rewrite # 2. Verify playback and fill snapshots source .env && uv run pytest tests/models/test_openai.py::test_chat_completion -vv --tb=line # 3. Review test code diffs (excludes cassettes) git diff tests/ -- ':!**/cassettes/**' # 4. List new/changed cassettes (name only - use parse_cassette.py to inspect) git diff --name-only tests/ -- '**/cassettes/**' # 5. Inspect cassette contents if needed uv run python .claude/skills/testing-skill/parse_cassette.py tests/models/cassettes/test_openai/test_chat_completion.yaml ```
Files in this package (2)
- SKILL.md 3 KB
- parse_cassette.py 3 KB
Versions
The database has no other skills named testing-skill.
Database snapshot: 13.11.2026 · package version b5161013b469 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100vcrpy
VCR.py records the HTTP calls a Python test makes into a cassette file and replays them on later runs, so tests that depend on third-party APIs become fast, offline and deterministic. Use when the user asks to stop tests hitting a real API, record or replay HTTP in pytest, fix… - 100langchain-local-dev-loop
Build a fast, deterministic local test loop for LangChain 1.0 / LangGraph\ \ 1.0\n\u2014 FakeListChatModel fixtures, pytest config, VCR cassettes with key\ \ redaction,\nwarning-filter policy. Use when adding tests to a new chain, fixing\ \ a flaky\ntest, or making integration… - 100pydantic-ai-testing
Test PydanticAI agents using TestModel, FunctionModel, VCR cassettes, and inline snapshots. Use when writing unit tests, mocking LLM responses, or recording API interactions. - 90test-component
Expert agent for writing and maintaining tests for Keboola Python components. Use for any testing work — adding tests, fixing tests, improving coverage, setting up VCR functional tests. Covers datadir tests, unit tests, mock-based tests, and VCR recording with… - 100zapros
Best-practice guide for writing Python code with the Zapros HTTP client (AsyncClient / Client). Use whenever code imports `zapros` or the user mentions Zapros — sending HTTP requests (query params, JSON/form/multipart bodies, streaming), reading responses, configuring clients,… - 90api-testing
Test an HTTP API at its boundary so status codes, response schemas, error bodies, and auth paths all hold under real requests. Use when adding or reviewing tests for a service that other clients call over HTTP.