From e77591eef7c7423d78bcbdb8256ac03b901fd498 Mon Sep 17 00:00:00 2001 From: Fraser Stark Date: Fri, 14 Jul 2023 17:13:59 +0100 Subject: [PATCH 1/3] changing parent class of PytestReturnNotNoneWarning --- AUTHORS | 1 + src/_pytest/warning_types.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 5ea751bbc28..466779f6d11 100644 --- a/AUTHORS +++ b/AUTHORS @@ -143,6 +143,7 @@ Feng Ma Florian Bruhin Florian Dahlitz Floris Bruynooghe +Fraser Stark Gabriel Landau Gabriel Reis Garvit Shubham diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index 31726e1ce22..4219f1439a2 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -61,7 +61,7 @@ class PytestRemovedIn9Warning(PytestDeprecationWarning): __module__ = "pytest" -class PytestReturnNotNoneWarning(PytestRemovedIn8Warning): +class PytestReturnNotNoneWarning(PytestWarning): """Warning emitted when a test function is returning value other than None.""" __module__ = "pytest" From c85c61565efc32d160b104a9e22fb121a4237043 Mon Sep 17 00:00:00 2001 From: Fraser Stark Date: Fri, 14 Jul 2023 17:27:31 +0100 Subject: [PATCH 2/3] updating changelog --- changelog/10465.deprecation.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/10465.deprecation.rst diff --git a/changelog/10465.deprecation.rst b/changelog/10465.deprecation.rst new file mode 100644 index 00000000000..8929bb7a447 --- /dev/null +++ b/changelog/10465.deprecation.rst @@ -0,0 +1 @@ +Test functions returning a value other than None will now return a warning and not an error. From 1793204872d531e0bd2f626b2a4f5a038ee9f9a9 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 7 Sep 2023 11:49:03 -0300 Subject: [PATCH 3/3] Improve and fix changelog --- changelog/10465.deprecation.rst | 2 +- changelog/11151.breaking.rst | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/changelog/10465.deprecation.rst b/changelog/10465.deprecation.rst index 8929bb7a447..a715af5e624 100644 --- a/changelog/10465.deprecation.rst +++ b/changelog/10465.deprecation.rst @@ -1 +1 @@ -Test functions returning a value other than None will now return a warning and not an error. +Test functions returning a value other than None will now issue a :class:`pytest.PytestWarning` instead of :class:`pytest.PytestRemovedIn8Warning`, meaning this will stay a warning instead of becoming an error in the future. diff --git a/changelog/11151.breaking.rst b/changelog/11151.breaking.rst index 2e86c5dfba0..114a7d8e20b 100644 --- a/changelog/11151.breaking.rst +++ b/changelog/11151.breaking.rst @@ -1,2 +1 @@ -Dropped support for Python 3.7, which `reached end-of-life on 2023-06-27 -`__. +Dropped support for Python 3.7, which `reached end-of-life on 2023-06-27 `__.