208663340/opc-delivery/python-testing
Claude Code and agent skill by 208663340/opc-delivery
- community
Checking that the SKILL.md file is still in the repository.
pytest testing for Python applications: test-first development, unit, integration, composition, and end-to-end boundaries; fixtures, mocks, fakes, async tests, and database fidelity. Use when writing or debugging tests, deciding test levels, or configuring pytest. For FastAPI or SQLAlchemy mechanics, use their dedicated skills.
Install
npx vskill@latest install 208663340/opc-delivery/python-testingSKILL.md
The same SKILL.md was published earlier as 208663340/opc-delivery/python-testing.
Testing with pytest
Test behavior at useful boundaries. The right test level depends on the contract and failure risk.
Test-First Development
Test at component boundaries, not internal implementation:
Follow test → implement → refactor:
- Write a focused failing behavior test.
- Implement the smallest correct behavior.
- Refactor while the test remains green.
Layer Boundary Testing Overview
Test what crosses layer boundaries, not internal implementation:
- Domain unit: Invariants and decisions.
- Application unit/contract: Business workflow with a fake or autospecced collaborator.
- Repository integration: Real database adapter against the required dialect.
- HTTP composition: Validation, serialization, status codes, and dependency wiring.
See references/boundaries.md for comprehensive layer-specific examples.
Entity Testing Example
Test business logic without framework DTOs:
Service Testing Example
Test orchestration with stubbed dependencies:
Repository Testing Example
Test the production dialect for database-specific behavior:
Router Testing Example
Test HTTP layer with TestClient:
Test Organization Basics
Reference Documentation
For comprehensive patterns and examples, see:
- references/boundaries.md - Layer boundary testing patterns with complete examples for each layer
- references/mocking.md - Mock strategies, verification methods, and anti-patterns
- references/pytest.md - Configuration, fixtures, markers, parametrization, and debugging
Async tests
With pytest-asyncio strict mode, mark async tests with @pytest.mark.asyncio and decorate async fixtures with @pytest_asyncio.fixture. Use AsyncMock and assert_awaited_once_with for async collaborators. See references/pytest.md for loop scopes and cleanup.
Security
- Security scanPassed, 90 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 repositoryCheckingskills/python-testing/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Grok Build (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/208663340/opc-delivery/python-testing)