-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add -rW option to print captured warnings even for passing tests #3633
Comments
#1232 can be used as basis to implement this. |
GitMate.io thinks possibly related issues are #3251 (Warnings not captured during test collection), #1370 (Print out pytest-warnings?), #2178 (output capture broken when sys.stdout passed to print()), #1173 (Option to treat warnings as errors), and #2191 (add an option to warn about Python 3.x possible incompatibilities). |
Hi, can I help contribute to this one? @nicoddemus |
Sure @jucaleb4, please go ahead! 👍 |
Awesome, thanks! I'll ask questions as they come along |
@nicoddemus has there been a solution merged? I am seeing seeing logic for the -rw option here https://github.com/pytest-dev/pytest/search?q=-rw&unscoped_q=-rw |
@KamRon-67 I think there's a subtlety here, which I'll try to convey properly. Currently, Anyone, please correct me if I understood this wrong. |
I looked into this and I believe it doesn't apply anymore (partly due to PR #3931)
A simple test shows that it works indeed, running pytest without any options gives you a warning summary import warnings
def test_success():
warnings.warn("hello")
return True In the example described in #3621 (comment), it's about an error inside a callback, not really a warning. I think it's the expected behavior: you wouldn't see the error running this code without pytest either. |
Indeed, thanks @vbarbaresi for reviewing this. 👍 Closing then. |
Follow up to #3621 (comment)
The text was updated successfully, but these errors were encountered: