Topic
Pytest fixtures, parametrization, mocking, async tests, framework integration, database isolation, and trustworthy test suites.
Practice items tagged with Testing & Quality.
Explains pytest fixture dependency resolution, caching, lifetime, and the isolation cost of wider scopes.
Explains reverse-order fixture cleanup and designs teardown that remains safe when setup or tests fail.
Verifies commit callbacks without confusing callback registration with durable external delivery.
Overrides FastAPI boundaries for focused tests and restores the global override mapping reliably.
Uses parametrization for one behavior across meaningful cases while keeping failures and intent easy to read.
Aligns pytest-asyncio discovery, loop lifetime, and async fixture ownership without custom loop competition.