From 58cf20edf08d84c5baf08f0566cc9bccbc4ec7fd Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 8 Aug 2022 10:14:49 +0100 Subject: [PATCH] Update :class:`pytest.PytestUnhandledCoroutineWarning` to a deprecation; it will raise an error in pytest 8. [SQUASH] (#10012) Co-authored-by: Bruno Oliveira --- changelog/10012.deprecation.rst | 1 + src/_pytest/warning_types.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 changelog/10012.deprecation.rst diff --git a/changelog/10012.deprecation.rst b/changelog/10012.deprecation.rst new file mode 100644 index 00000000000..66681263e32 --- /dev/null +++ b/changelog/10012.deprecation.rst @@ -0,0 +1 @@ +Update :class:`pytest.PytestUnhandledCoroutineWarning` to a deprecation; it will raise an error in pytest 8. diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index ebfeb87d842..c32ce80ccb1 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -55,7 +55,6 @@ class PytestRemovedIn8Warning(PytestDeprecationWarning): __module__ = "pytest" -@final class PytestReturnNotNoneWarning(PytestDeprecationWarning): """Warning emitted when a test function is returning value other than None.""" @@ -82,7 +81,7 @@ def simple(cls, apiname: str) -> "PytestExperimentalApiWarning": @final -class PytestUnhandledCoroutineWarning(PytestWarning): +class PytestUnhandledCoroutineWarning(PytestReturnNotNoneWarning): """Warning emitted for an unhandled coroutine. A coroutine was encountered when collecting test functions, but was not