From 333e4eba6b09f40f80aaeee6581a37c5af34aad7 Mon Sep 17 00:00:00 2001 From: Fraser Stark Date: Thu, 7 Sep 2023 16:11:59 +0100 Subject: [PATCH] Change PytestReturnNotNoneWarning to return a normal warning (#11211) Fixes #10465 --- AUTHORS | 1 + changelog/10465.deprecation.rst | 1 + changelog/11151.breaking.rst | 3 +-- src/_pytest/warning_types.py | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 changelog/10465.deprecation.rst diff --git a/AUTHORS b/AUTHORS index 5ea751bbc..466779f6d 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/changelog/10465.deprecation.rst b/changelog/10465.deprecation.rst new file mode 100644 index 000000000..a715af5e6 --- /dev/null +++ b/changelog/10465.deprecation.rst @@ -0,0 +1 @@ +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 2e86c5dfb..114a7d8e2 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 `__. diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index 31726e1ce..4219f1439 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"