Write and review high-quality Python tests using pytest. Use whenever creating new tests, refactoring existing tests, debugging test failures, improving coverage, mocking dependencies, mocking HTTP calls, or generating test data — even when the user says "tests" without further detail. Enforces pytest-mock over unittest.mock, mandatory type annotations and docstrings, fixtures kept out of test files (in conftest.py or modules imported by it), factories for test data, pytest-httpx for HTTP mocks, ≥90% coverage (target ≥95%), and testing only public interfaces — never private functions or methods.
2026-07-09