What problem does it solve? Tests that pass in isolation but fail in combined pytest sessions are usually victims of leaked module-level mutable state — global registries, singletons, class attributes, and dependency override dicts that one test mutates and another inherits. ## Core Features & Use Cases - Pattern Catalog: Documents common pollution sources such as module-level dicts (connection pool caches, active-user caches), rate-limiter singletons, and FastAPI dependency_overrides. - Mitigation Patterns: Provides a reset-hook conftest fixture and a per-test pool pattern with try/finally teardown to guarantee state cleanup. - Diagnostic Commands: Supplies grep commands to locate module-level mutable state, singletons, and class attributes across a Python codebase. - Use Case: A test creates a SQLite pool at tmp_path/test.db and the next test at the same path reuses a stale pool with different settings; apply the reset fixture to clear _pool_cache between tests. ## Quick Start Ask the assistant to review a failing pytest test for module-level state leaks and add a reset fixture to conftest.py.