diff --git a/pytest.ini b/pytest.ini index 2f4c80e..64b048b 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,2 +1,11 @@ [pytest] asyncio_mode = auto +# pytest-asyncio 1.x changed the default fixture loop scope. With it +# unset, pytest-asyncio 1.x emits a deprecation warning and the +# session-scoped fixtures bind to a different event loop than the +# per-test functions, producing "another operation is in progress" +# (asyncpg) and "attached to a different loop" (asyncio) errors. +# Pinning the scope explicitly keeps pytest-asyncio 0.24.x and 1.x +# behaviorally identical and unblocks the Dependabot pytest-asyncio +# 1.3.0 bump (#40). +asyncio_default_fixture_loop_scope = function