Repository navigation
-rx and -rX should turn on output for xfail/xpass #11233
Description
Activity
I'd be happy to work on this, but first I was hoping for
- Agreement that
-rxand-rXare the right way to control output for xfail/xpass. - Some hint at where in the code the changes should go.
reports.py? - A hint at which tests could be used as examples to test this change in behavior
Of course, I'd be "happier" if someone else worked on this. :)
- Agreement that
Note that this is a significant problem for me currently, and we don't have a workable solution.
I'm looking in
terminal.pynow.
It looks like there are sections for ERRORS, FAILURES, PASSES.
Seems like there needs to be also XFAILURES and XPASSES sections, perhaps after FAILURES and before PASSES.- addedtype: bugproblem that needs to be addressedproblem that needs to be addressedtype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature
on Jul 20, 2023 I'm not sure if I'm using labels right. I think this missing functionality is a bug, and I have a proposed way it should work.
Hi @okken,
Sorry for the silence on this, seems like this one fell through the cracks.
Agreement that -rx and -rX are the right way to control output for xfail/xpass.
I think so.
Some hint at where in the code the changes should go. reports.py?
That would go into
terminal.py.A hint at which tests could be used as examples to test this change in behavior
There are several tests in
test_terminal.pythat handle the-roptions.There's #11574 if you want to comment/help review. 👍
- added 6 commits that reference this issue
on May 28, 2024 - added 2 commits that reference this issue
on Jun 29, 2024
-rxand-rX(as well as-raand-rA) should allow output for xfail and xpass, but they don't.This shows up in a discussion #9834 and another issue #10618.
-rxand-rXare the obvious choice.---- More detail about problem and expectations ----
Observations:
Based on a simple test script below that includes
test_pass,test_fail,test_xfail,test_xpass.Output and exception for
test_failbut not fortest_xfail.test_xfailto look mostly just liketest_fail.assert 1 == 2is displayed in summary info forFAILEDbut not forXFAIL.assert 1 == 2should show up for XFAIL also.-rP(which is included in-rA) is "pass with output", and it applies toPASSED, but notXPASS.Opinion on how to fix this:
XFAILshould act likeFAILEDif it's turned on with-rxor-raor-rAXPASSshould act likePASSEDif it's turned on with-rXor-raor-rA-rflags seems like the right way to do this.My opinions, of course. But this would follow the idea of "behavior with the least surprise". And it doesn't require any extra flags.
pip listfrom the virtual environment you are usingpytest and operating system versions
minimal example if possible
Example: test_foo.py
Current output: