-
-
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
XFail and XPass output does not get printed to console #10618
Comments
That's intentional, With strict, xpass gets treated as error and should have output |
Interesting, I was not aware of that option. I put that in pytest.ini, and the XPass now shows up as a Failure, as you had mentioned. I still don't see anything related to XFail - which I know you didn't say would be there - but is there a way to have XFails print out their output? (Also curious why the capture stdout call section prints the log messages in triplicate.)
|
While the behavior is intended, is there any way to log this information as part of the summary of the test? For example, by using report hooks. One of my use cases is to run typing tests on a legacy code base (unstable typing) and to produce a test per error code so that I can catch regression errors once a given error code is stable. |
I believe this was fixed by #11574, in Pytest 8.0 🙂 |
I don't see any output on the console when I run tests marked XFail or XPass. In fact, these tests only show up in the summaries, not in the PASSES nor the FAILURES section, where I would expect to see them. This would seem to be a fairly serious oversight, since testers certainly want to see the output of their tests that have been marked as such. Am I missing something?
Now, if I specify 'live logs' on the command line, I get my expected output, but only live; not captured. Given that a lot of pytest users probably don't know about this option, wouldn't it make sense to print the stdout/stderr/stdlog to console by default when processing XFail and XPass cases?
Thanks, Jeff
Example console outputs:
Test file:
The text was updated successfully, but these errors were encountered: