-
-
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
Please make verbose XFAIL tracebacks optional #12231
Comments
@mgorny I agree, for projects with a lot of xfail tests it produces too much output. Do you have a suggestion of what the option would be? |
I'm terrible at naming, so I'd go for |
Yeah, sure, that would work for me too. |
I’d be ok with a separate -r letter. Also, if a separate option, --xfail-tb with no/short/long, etc, like the existing --tb flag, wouldn’t be terrible. But it might be harder to implement. |
Yes, please! I just spent 10 minutes trying to track down why my CI job was reporting a failure, and assumed it was because of the XFAIL tracebacks (but it was not, coverage dropped below the required threshold). |
I like Would love to see a PR in this direction -- should be a simple extension of the work done in #11574. |
I can take a look, probably next week. |
Initial implementation looking pretty good so far. So turning off xfail tracebacks could be done with @nicoddemus Should we default |
My opinion is to default to |
I agree with defaulting to |
Thanks everyone for your rapid feedback on this. |
Ok. This is more difficult than I imagined at first. Perhaps a change of plans. How about, we leave the styling of tracebacks to I've modified the changelog entry, tests, and code to treat |
I agree, that was what I meant by this:
I see you closed the PR, was that intentional? |
No. Not intentional. I’ll try to recover PR Later tonight. |
Accidentally deleted my fork, along with this branch. |
Thanks a lot! |
What's the problem this feature will solve?
Since #11735,
-rx
causes pytest to output tracebacks for expected failures. This is sometimes undesirable with projects that have a lot of xfail-ing tests. For example, with pandas outputting XFAIL tracebacks takes a few minutes and results in 80M of output.Describe the solution you'd like
I think the cleanest solution would be to have another option to control whether tracebacks are displayed for XFAILs. This would make it possible to retain XFAIL in summary output (via
-rx
or-ra
), without the extra overhead of printing all the tracebacks.Alternative Solutions
We could avoid passing
-rx
, but then we'd lose the list of XFAILs from test summary, and that one is actually desirable.Additional context
n/a
The text was updated successfully, but these errors were encountered: