From 1a02495ec43aed601c9b7f6102d8ba491efa93cb Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Fri, 4 Oct 2024 09:46:53 +0200 Subject: [PATCH] chore: set pytest-asyncio loop scope to function (#566) To resolve the deprecation warning: ``` warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET)) ready: 12/16 workers/home/vdusek/Projects/crawlee-python/.venv/lib/python3.12/site-packages/pytest_asyncio/plugin.py:208: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset. 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" ``` --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 22ef30b7..a0d90765 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -187,6 +187,7 @@ max-branches = 18 [tool.pytest.ini_options] addopts = "-ra" +asyncio_default_fixture_loop_scope = "function" asyncio_mode = "auto" timeout = 1200