pytest icon indicating copy to clipboard operation
pytest copied to clipboard

issue-10113/Change error message

Open jekwatt opened this issue 3 years ago • 1 comments

Fixes #10113.

jekwatt avatar Jul 16 '22 21:07 jekwatt

That seems like it would now make the error message confusing for the far more common case, when there indeed is a test which wasn't found...

The-Compiler avatar Jul 16 '22 22:07 The-Compiler

@The-Compiler would you like to decline the PR then?

nicoddemus avatar Oct 09 '22 13:10 nicoddemus

@The-Compiler - it's been a year, let's either merge this or close it and close the issue as wontfix.

Zac-HD avatar Jul 04 '23 17:07 Zac-HD

Sorry for the radio silence, this got lost in my inbox with all the Europython stuff :sweat_smile:

I still think that in the common case of:

$ pytest tests/unit/test_app.py::test_bla
============================= test session starts ==============================
[...]
collected 0 items                                                              

============================ no tests ran in 0.02s =============================
ERROR: not found: .../tests/unit/test_app.py::test_bla
(no name '.../tests/unit/test_app.py::test_bla' in any of [<Module tests/unit/test_app.py>])

"not found" makes things clearer vs. "couldn't collect" (after all, the collection did work!). As shown in https://github.com/pytest-dev/pytest/issues/10113#issuecomment-1178868063 I believe the existing error message is sufficient for this far more exotic case.

Thus I'm closing this - thanks for the contribution anyways though, @jekwatt, and sorry for the loooong delay!

The-Compiler avatar Aug 08 '23 20:08 The-Compiler