Skip to content
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

PytestReturnNotNoneWarning now subclasses PytestRemovedIn8Warning #10196

Merged
merged 7 commits into from Oct 9, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/10196.trivial.rst
@@ -0,0 +1 @@
make PytestReturnNotNoneWarning a RemovedIn8Warning
3 changes: 1 addition & 2 deletions src/_pytest/warning_types.py
Expand Up @@ -48,14 +48,13 @@ class PytestDeprecationWarning(PytestWarning, DeprecationWarning):
__module__ = "pytest"


@final
class PytestRemovedIn8Warning(PytestDeprecationWarning):
"""Warning class for features that will be removed in pytest 8."""

__module__ = "pytest"


class PytestReturnNotNoneWarning(PytestDeprecationWarning):
class PytestReturnNotNoneWarning(PytestRemovedIn8Warning):
Copy link
Member

@nicoddemus nicoddemus Oct 9, 2022

Choose a reason for hiding this comment

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

Sorry, I don't recall the original discussion, do we ever plan to make returning non-None an error? Do you have a link to the original discussion?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Ahh thanks!

"""Warning emitted when a test function is returning value other than None."""

__module__ = "pytest"
Expand Down