Skip to content

Update :class:pytest.PytestUnhandledCoroutineWarning to a deprecation; it will raise an error in pytest 8. [SQUASH] #10012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/10012.deprecation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update :class:`pytest.PytestUnhandledCoroutineWarning` to a deprecation; it will raise an error in pytest 8.
3 changes: 1 addition & 2 deletions src/_pytest/warning_types.py
Original file line number Diff line number Diff line change
@@ -55,7 +55,6 @@ class PytestRemovedIn8Warning(PytestDeprecationWarning):
__module__ = "pytest"


@final
class PytestReturnNotNoneWarning(PytestDeprecationWarning):
Copy link
Member Author

@graingert graingert Jul 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RonnyPfannschmidt requested that PytestReturnNotNoneWarning be a RemovedIn8Warning and I agree, but the @final decorator on RemovedIn8Warning prevents that.

"""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