pytest-ruff icon indicating copy to clipboard operation
pytest-ruff copied to clipboard

Chongus tracebacks when failed test

Open lexi-k opened this issue 1 year ago • 2 comments

Hello, when ruff check fails it also prints out giant tracebacks from pytest (sometimes even ~2.3k lines) just to inform me that I forgot to sort imports, or whatever. I found that there is --tb=short or --tb=line switch for pytest to reduce the clutter, but I would like to see stack traces within other tests if possible. This is an example screenshot of one RuffError (I can't even tell what the error is since it just says pytest_ruff.RuffError) in one file with --tb=short flag.

Would it be please possible to not include the tracebacks without the need to shorten all other tracebacks with the --tb=... flag)?

image

lexi-k avatar Apr 04 '24 09:04 lexi-k

Despite this claiming to be fixed, I'm still seeing 1.1k lines of traceback per Ruff violation on pytest-ruff==0.4.1. Is this expected? https://github.com/pypa/setuptools/actions/runs/10030506583/job/27719893772?pr=4392#step:9:64

Avasam avatar Jul 22 '24 16:07 Avasam

Definitely we do not want the full traceback. I'm not sure how to silence it, but I'll investigate. Thanks for the report @Avasam!

iurisilvio avatar Jul 22 '24 19:07 iurisilvio