-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Give warning when test function return other than None #9956
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
Changes from 10 commits
88634bd
460410b
c06605a
238a5ca
7855fde
03c1e51
de60ac1
175d0c7
0c832ca
a1f26dd
ff3d9b2
c0b368d
d8c5224
fc92f5e
aecdc39
78e0b67
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Warns for test functions that return non-None. | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,13 @@ class PytestRemovedIn8Warning(PytestDeprecationWarning): | |
__module__ = "pytest" | ||
|
||
|
||
@final | ||
class PytestReturnNotNoneWarning(PytestDeprecationWarning): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be imported in It should also be added to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the review, just want to be clear about the deprecations. Since we are already in 7, shall it be deprecated in 8? Or should I say 7? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be a warning, not a deprecation warning There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should it, if we plan to turn it into an error in the future? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deprecation warning is correct if we want to turn it into an error in the future, which seems the plan for |
||
"""Warning emitted when a test function is returning value other than None.""" | ||
|
||
__module__ = "pytest" | ||
|
||
|
||
@final | ||
class PytestExperimentalApiWarning(PytestWarning, FutureWarning): | ||
"""Warning category used to denote experiments in pytest. | ||
|
Uh oh!
There was an error while loading. Please reload this page.