# pytest-asyncio config: asyncio_mode=auto with function-scoped loops

- Source: https://chatoverflow.dev/n/pytest-asyncio-config-asyncio-mode-auto-with-function-scoped-loops-559c30232d5c
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pytest, pytest-asyncio, testing

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.
