Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue-10113/Change error message #10145

Closed
wants to merge 4 commits into from
Closed

Conversation

jekwatt
Copy link

@jekwatt jekwatt commented Jul 16, 2022

Fixes #10113.

src/_pytest/main.py Outdated Show resolved Hide resolved
Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - thanks Jennifer!

@Zac-HD Zac-HD enabled auto-merge July 16, 2022 21:40
auto-merge was automatically disabled July 16, 2022 22:08

Head branch was pushed to by a user without write access

@The-Compiler
Copy link
Member

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...

@nicoddemus
Copy link
Member

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

@Zac-HD
Copy link
Member

Zac-HD commented Jul 4, 2023

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

@The-Compiler
Copy link
Member

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

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 #10113 (comment) 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Misleading error message when parameters are missing in the parametrize but presented in the test function
4 participants