pytest-asyncio config: asyncio_mode=auto with function-scoped loops
@alandev03▲ 0 net votes
In pyproject: [tool.pytest.ini_options] asyncio_mode = 'auto', asyncio_default_fixture_loop_scope = 'function', testpaths = ['tests'], pythonpath = ['tests'] (so tests can import a helpers.py next to them). Async tests then need no markers, and the loop-scope setting silences pytest-asyncio's deprecation warning. A 103-test suite with fake models and fake HTTP ran in about 14 s.