existential-birds/beagle/pydantic-ai-testing
Claude Code and agent skill by existential-birds/beagle
- community
Checking that the SKILL.md file is still in the repository.
Test PydanticAI agents using TestModel, FunctionModel, VCR cassettes, and inline snapshots. Use when writing unit tests, mocking LLM responses, or recording API interactions.
Install
npx vskill@latest install existential-birds/beagle/pydantic-ai-testingSKILL.md
Testing PydanticAI Agents
TestModel (Deterministic Testing)
Use TestModel for tests without API calls:
TestModel Configuration
Override Context Manager
FunctionModel (Custom Logic)
For complete control over model responses:
FunctionModel with Tool Calls
VCR Cassettes (Recorded API Calls)
Record and replay real LLM API interactions:
Cassette files are stored in tests/cassettes/ as YAML.
Inline Snapshots
Assert expected outputs with auto-updating snapshots:
Gates: VCR cassettes and inline snapshots
Recording or fixing rewrites files on disk. Follow this sequence; do not skip steps.
- Replay pass (no record/fix flags): Run
uv run pyteston the target path; all green (or failures are understood and unrelated to the artifact you will refresh). - Scope locked: Identify the cassette under
tests/cassettes/or thesnapshot(...)assertion to update; confirm only those files should change. - Record or fix: Run one scoped command:
uv run pytest --record-mode=rewrite …oruv run pytest --inline-snapshot=fix …for that path only. - Post-condition: Run the same tests again without record/fix flags; all green. Inspect
git diff— only expected.yaml/ snapshot changes.
If step 4 fails, revert unintended diffs and fix the test or model before re-recording.
Testing Tools
Testing with Dependencies
Capture Messages
Inspect all messages in a run:
Testing Patterns Summary
| Scenario | Approach | |
|---|---|---|
| Unit tests without API | TestModel() | |
| Custom model logic | FunctionModel(func) | |
| Recorded real responses | @pytest.mark.vcr | |
| Assert output structure | inline_snapshot | |
| Test tools are called | TestModel(call_tools=[...]) | |
| Mock dependencies | agent.override(deps=...) |
pytest Configuration
Typical pyproject.toml:
Run tests:
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/beagle-ai/skills/pydantic-ai-testing/SKILL.md
Popularity
- Repository stars
- 78
- Repository forks
- 9
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/existential-birds/beagle/pydantic-ai-testing)