From 75a1a6ce4bdffb749527bc8e4f756e6e5f36f1b8 Mon Sep 17 00:00:00 2001 From: Michael Seifert Date: Wed, 12 Jul 2023 10:28:03 +0200 Subject: [PATCH] [feat] Extend warning message about unclosed event loops with additional possible cause. Closes #531 Signed-off-by: Michael Seifert --- docs/source/reference/changelog.rst | 2 ++ pytest_asyncio/plugin.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/source/reference/changelog.rst b/docs/source/reference/changelog.rst index 8e5e7d08..00b73fa0 100644 --- a/docs/source/reference/changelog.rst +++ b/docs/source/reference/changelog.rst @@ -5,6 +5,8 @@ Changelog 0.22.0 (UNRELEASED) =================== - Output a proper error message when an invalid ``asyncio_mode`` is selected. +- Extend warning message about unclosed event loops with additional possible cause. + `#531 `_ 0.21.0 (2023-03-19) =================== diff --git a/pytest_asyncio/plugin.py b/pytest_asyncio/plugin.py index b7c3fcbf..12669791 100644 --- a/pytest_asyncio/plugin.py +++ b/pytest_asyncio/plugin.py @@ -434,7 +434,8 @@ def _add_finalizers(fixturedef: FixtureDef, *finalizers: Callable[[], object]) - library will no longer do so. In order to ensure compatibility with future versions, please make sure that: 1. Any custom "event_loop" fixture properly closes the loop after yielding it - 2. Your code does not modify the event loop in async fixtures or tests + 2. The scopes of your custom "event_loop" fixtures do not overlap + 3. Your code does not modify the event loop in async fixtures or tests """ )