When to Apply: Reference when writing Python tests with pytest, using fixtures for setup/teardown, parameterizing tests with @pytest.mark.parametrize, or configuring conftest.py for shared fixtures. Triggers on "pytest", "conftest", "@pytest.fixture", "@pytest.mark", "Python test".
Playbook Deep Dive (11 sections): §1 Production Configuration · §2 Fixtures (Scoping, Factories, Teardown) · §3 Parameterized Tests · §4 Mocking with pytest-mock · §5 Async Testing · §6 Testing Exceptions & Warnings · §7 Markers & Custom Plugins · §8 Class-Based Test Organization · §9 CI/CD Integration · §10 Debugging Table · §11 Best Practices
The agent loads from 2 on-demand reference files (advanced-patterns.md, playbook.md) containing detailed implementation guides, cloud integration patterns, debugging tables, and language-specific best practices.