[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-04-28 19:56:47 +00:00
parent a9e8ead563
commit f138f1d288
2 changed files with 5 additions and 7 deletions

View File

@ -1,16 +1,14 @@
Add `--xfail-tb` flag, which acts a lot like `--tb`, but controls the traceback output for XFAIL results. Add `--xfail-tb` flag, which acts a lot like `--tb`, but controls the traceback output for XFAIL results.
* The `--xfail-tb` flag takes one argument, `auto|long|short|line|native|no`, and defaults to `no`. * The `--xfail-tb` flag takes one argument, `auto|long|short|line|native|no`, and defaults to `no`.
* To turn on xfail tracebacks, pass in `-rx` or `-ra` along with `--xfail-tb=short` (or any of `auto`, `long`, `short`, `line`, or `native`). * To turn on xfail tracebacks, pass in `-rx` or `-ra` along with `--xfail-tb=short` (or any of `auto`, `long`, `short`, `line`, or `native`).
The `--tb` flag, that controls normal test failure tracebacks, defaults to `auto`. The `--tb` flag, that controls normal test failure tracebacks, defaults to `auto`.
This change really only separates the traceback behavior of normal vs xfail failures. This change really only separates the traceback behavior of normal vs xfail failures.
Some history: Some history:
* This is a behavior break, but brings default behavior back to pre-8.0.0 behavior. * This is a behavior break, but brings default behavior back to pre-8.0.0 behavior.
* With this change, default `-rx`/ `-ra` behavior is identical to pre-8.0 with respect to xfail tracebacks. * With this change, default `-rx`/ `-ra` behavior is identical to pre-8.0 with respect to xfail tracebacks.
* With pytest 8.0, `-rx` or `-ra` would not only turn on summary reports for xfail, but also report the tracebacks for xfail results. * With pytest 8.0, `-rx` or `-ra` would not only turn on summary reports for xfail, but also report the tracebacks for xfail results.
* This caused issues with some projects that utilize xfail, but don't want to see all of the xfail tracebacks. * This caused issues with some projects that utilize xfail, but don't want to see all of the xfail tracebacks.

View File

@ -2933,7 +2933,7 @@ def test_xfail_tb_default(pytester: Pytester) -> None:
"*= 1 xfailed in * =*", "*= 1 xfailed in * =*",
] ]
) )
def test_xfail_tb_short(pytester: Pytester) -> None: def test_xfail_tb_short(pytester: Pytester) -> None:
pytester.makepyfile( pytester.makepyfile(