Testing
Python Database Testing Anti-Patterns: Mocking vs Real DB, Fixture Isolation, and Test Speed
Most Python database test suites share the same set of mistakes. Tests that mock Session.query(). Fixtures that share state between tests. Integration tests that take 20 minutes because developers tried to be too thorough. This guide identifies the most damaging anti-patterns and shows how to replace them with patterns