From a7be13b901f8b539867b6cc2745ad5ffaa98dd70 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Fri, 29 Jul 2022 10:22:44 +0100 Subject: [PATCH 1/5] deprecate returning awaitables --- src/_pytest/warning_types.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 From 0d55deec09ca5aa1d78cb8371a9b61ade28cf515 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 3 Aug 2022 23:33:05 +0100 Subject: [PATCH 2/5] Create 10012.deprecation.rst --- changelog/10012.deprecation.rst | 1 + 1 file changed, 1 insertion(+) 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..bb821a0defc --- /dev/null +++ b/changelog/10012.deprecation.rst @@ -0,0 +1 @@ + upgrade PytestUnhandledCoroutineWarning to PytestDeprecationWarning From e5a4b7059d2bba47161e144d46cd967cb3929bab Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 3 Aug 2022 23:35:16 +0100 Subject: [PATCH 3/5] Update 10012.deprecation.rst --- changelog/10012.deprecation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/10012.deprecation.rst b/changelog/10012.deprecation.rst index bb821a0defc..4933bd676f4 100644 --- a/changelog/10012.deprecation.rst +++ b/changelog/10012.deprecation.rst @@ -1 +1 @@ - upgrade PytestUnhandledCoroutineWarning to PytestDeprecationWarning +upgrade :class:`pytest.PytestUnhandledCoroutineWarning` it will raise an error in pytest 8 From 7a4cf2aa67a9e498db8e2d46c5ec97ca26e3ad5a Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 3 Aug 2022 23:35:39 +0100 Subject: [PATCH 4/5] Update 10012.deprecation.rst --- changelog/10012.deprecation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/10012.deprecation.rst b/changelog/10012.deprecation.rst index 4933bd676f4..a643113f3ac 100644 --- a/changelog/10012.deprecation.rst +++ b/changelog/10012.deprecation.rst @@ -1 +1 @@ -upgrade :class:`pytest.PytestUnhandledCoroutineWarning` it will raise an error in pytest 8 +upgrade :class:`pytest.PytestUnhandledCoroutineWarning` to a deprecation it will raise an error in pytest 8 From 42950adae301b9d0d6751ba19a40a42db7f7ec4c Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Fri, 5 Aug 2022 11:10:57 +0100 Subject: [PATCH 5/5] Update changelog/10012.deprecation.rst Co-authored-by: Bruno Oliveira --- changelog/10012.deprecation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/10012.deprecation.rst b/changelog/10012.deprecation.rst index a643113f3ac..66681263e32 100644 --- a/changelog/10012.deprecation.rst +++ b/changelog/10012.deprecation.rst @@ -1 +1 @@ -upgrade :class:`pytest.PytestUnhandledCoroutineWarning` to a deprecation it will raise an error in pytest 8 +Update :class:`pytest.PytestUnhandledCoroutineWarning` to a deprecation; it will raise an error in pytest 8.