From 583ede010ca58b0411fec7e5023bcc86c9a774cb Mon Sep 17 00:00:00 2001 From: Jay Bazuzi Date: Sun, 23 Nov 2025 11:07:18 -0800 Subject: [PATCH] trivial: Formatting in default fixture loop scope message style: reformatting docs: Add news fragment. --- changelog.d/1298.changed.rst | 1 + pytest_asyncio/plugin.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 changelog.d/1298.changed.rst diff --git a/changelog.d/1298.changed.rst b/changelog.d/1298.changed.rst new file mode 100644 index 00000000..49f83c83 --- /dev/null +++ b/changelog.d/1298.changed.rst @@ -0,0 +1 @@ +Improved the readability of the warning message that is displayed when ``asyncio_default_fixture_loop_scope`` is unset diff --git a/pytest_asyncio/plugin.py b/pytest_asyncio/plugin.py index 00c3c208..28c97cc9 100644 --- a/pytest_asyncio/plugin.py +++ b/pytest_asyncio/plugin.py @@ -221,10 +221,10 @@ def _get_asyncio_debug(config: Config) -> bool: _DEFAULT_FIXTURE_LOOP_SCOPE_UNSET = """\ The configuration option "asyncio_default_fixture_loop_scope" is unset. -The event loop scope for asynchronous fixtures will default to the fixture caching \ +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: \ +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" """