Open edmorley opened 1 year ago
If I make a Python syntax error in a test, or one of the project files imported by one of the tests, with stock pytest, I get an error like:
$ pytest ====================================== test session starts ======================================= platform darwin -- Python 3.11.0, pytest-7.2.0, pluggy-1.0.0 rootdir: /Users/<snip>, configfile: pyproject.toml, testpaths: tests plugins: anyio-3.6.2 collected 0 items / 2 errors ============================================= ERRORS ============================================= _______________________________ ERROR collecting tests/test_cli.py _______________________________ ImportError while importing test module '<snip>/tests/test_cli.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: <snip> ===================================== ERROR tests/test_cli.py !!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ======================================= 2 errors in 0.14s ========================================
However with pytest-rich installed and using pytest run using --rich, these errors are hidden:
pytest-rich
--rich
$ pytest --rich ────────────────────────────────────────────── pytest session starts ────────────────────────────────────────────── ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ platform darwin pytest 7.2.0 python 3.11.0 │ │ root /Users/<snip> │ │ plugins rich-0.1.2.dev26+gaea02fb, anyio-3.6.2 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ Collected 0 items ╭──── Summary ─────╮ │ 0 Total │ │ Tests │ ╰──────────────────╯ ───────────────────────────────────────────── FAILED in 0.00 seconds ──────────────────────────────────────────────
This was using the latest development version of pytest-rich (currently aea02fbe1e8dc85d7216e343ec52d06244ddc8c9).
Thanks for taking the time to submit this detailed issue @edmorley!
If I make a Python syntax error in a test, or one of the project files imported by one of the tests, with stock pytest, I get an error like:
However with
pytest-rich
installed and using pytest run using--rich
, these errors are hidden:This was using the latest development version of
pytest-rich
(currently aea02fbe1e8dc85d7216e343ec52d06244ddc8c9).