What problem does it solve?
Python testing becomes slow, flaky, and hard to trust when teams don’t have consistent pytest patterns for fixtures, parametrization, mocking, async tests, and coverage-backed TDD.
Core Features & Use Cases
- pytest fixture architecture: guidance on composing fixtures (including scopes and conftest sharing) to remove duplication and prevent shared state bugs.
- parametrization and test selection: patterns for
@pytest.mark.parametrize, custom markers, and marker-based filtering (like unit vs integration vs slow).
- mocking that stays maintainable: recommended approaches for patching, mocking exceptions, context managers, and async calls using
pytest-mock-style workflows.
- async testing support: clear usage for
pytest-asyncio, async fixtures, and async function mocking assertions.
- coverage and TDD flow: RED → GREEN → REFACTOR workflow and instructions to measure coverage with
pytest --cov while tying tests to invariants and risk surfaces.
Quick Start
Ask to generate a set of pytest tests for a Python change using fixtures and parametrization, and to mock external dependencies so the tests stay fast and non-brittle.