Python Async Testing
Problem Statement
Async testing requires specific patterns. pytest-asyncio has modes that affect behavior. Database tests need isolation. Mocking async functions differs from sync. Get these wrong and tests are flaky or don't catch bugs.
Pattern: pytest-asyncio Configuration
Problem: Pytest needs configuration for async tests.
# pyproject.toml
[tool.pytest.ini_options]
asyncio_mode = "strict" # Requires explicit @pytest.mark.asyncio
# OR
asynci
[Description truncada. Veja o README completo no GitHub.]