From 2d5048adcc50c1bf99c2c83d6959fe61243aa21b Mon Sep 17 00:00:00 2001 From: Ben Browning Date: Mon, 9 Jun 2025 13:59:06 -0400 Subject: [PATCH] Default the pytest asyncio fixture loop scope Fixes `INTERNALERROR` spam from pytest when run under unitcov - things like: ``` INTERNALERROR> pytest.PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset. INTERNALERROR> The event loop scope for asynchronous fixtures will default to the fixture caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to function scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session" ``` Signed-off-by: Ben Browning --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index a4cf0312..a98fd282 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,6 +103,7 @@ exclude = [ follow_imports = "silent" [tool.pytest.ini_options] +asyncio_default_fixture_loop_scope = "function" markers = [ "gpu: marks tests that should run with gpus (deselect with '-m \"not gpu\"')", ]