-
-
Notifications
You must be signed in to change notification settings - Fork 553
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
Redirect warning output from stderr to stdout in doctests #39647
base: develop
Are you sure you want to change the base?
Conversation
Documentation preview for this PR (built with commit 7a1c8e9; changes) is ready! 🎉 |
Seems semantically incorrect because…
→ https://docs.python.org/3/library/warnings.html#warnings.showwarning
How would programs that are tested using pytest normally test for warnings to be raised then? |
Right, but in the context of doctest the distinction between stdout and stderr doesn't seem to be relevant (both are printed-out as strings by default).
In normal pytest methods, one can use the Sympy has a [ |
If this function is to be used nowhere outside doctest then I suppose this is acceptable. But I suggest modify the documentation for Is there really no other occurrence of stderr being used? This feels weird. |
Yes, it's part of
Done.
Not that I could find. |
Pytest considers ouput in
stderr
as errors, thus we redirect the doctest warnings tostdout
instead. Doesn't seem to make a difference for sage's doctest runner.📝 Checklist
⌛ Dependencies