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

Clarify error message in case no collectors are found for a file #9823

Merged
merged 8 commits into from Apr 22, 2022

Conversation

tobiasdiez
Copy link
Contributor

In case no collector is found for a given file (e.g. if you run pytest something.unrecognized), then the somewhat cryptic error message

ERROR: not found: something.unrecognized
(no name 'something.unrecognized' in any of [])

With this PR, a more meaningful error message is displayed.

Not sure if such an almost-trivial change warrants an a changelog and authors entry.

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Not sure if such an almost-trivial change warrants an a changelog and authors entry.

I think so, improvements (however small) are worthy of note. 😁

Plus we need a test for the change, specially to ensure it doesn't regress. 👍

@tobiasdiez
Copy link
Contributor Author

Thanks for the feedback. I've now added a changelog and authors entry, and fixed the tests.

Copy link
Member

@nicoddemus nicoddemus 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, thank you!

@Zac-HD
Copy link
Member

Zac-HD commented Apr 21, 2022

@tobiasdiez - you'll need to merge in main in order to fix the jinja2 issue; then we should be ready to merge 🎉

@nicoddemus nicoddemus merged commit 1e8e46d into pytest-dev:main Apr 22, 2022
24 checks passed
@tobiasdiez
Copy link
Contributor Author

Thanks, that worked like a charm!

@tobiasdiez tobiasdiez deleted the patch-1 branch April 22, 2022 10:28
@Zac-HD
Copy link
Member

Zac-HD commented Apr 22, 2022

Thank you for the patch! Good error messages are enormously important to users, but so often neglected - it's a tricky form of "expert blindness" which makes contributions especially valuable 😍

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.

None yet

3 participants