issue-10113/Change error message
Fixes #10113.
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 would you like to decline the PR then?
@The-Compiler - it's been a year, let's either merge this or close it and close the issue as wontfix.
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!