-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Catch conftest blocking #14018
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
Catch conftest blocking #14018
Conversation
|
@RonnyPfannschmidt could you please check if that what you had in mind for the issue? |
4a01e4b to
ef8e215
Compare
nicoddemus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Backport to 9.0.x: 💚 backport PR created✅ Backport PR branch: Backported as #14074 🤖 @patchback |
) Show a clear message when `-p` is used for a `conftest.py` file, instead of raising an internal assertion error. Fixes #13634 (cherry picked from commit 004a967) Co-authored-by: Bubble-Interface <[email protected]>
closes #13634
Summary
This PR fixes an issue where attempting to disable a
conftest.pyfile using the-p no:option resulted in an internal assertion failure.conftest.pyfiles are not plugins and cannot be enabled or disabled using-p, but pytest previously accepted such arguments and crashed later during plugin loading with:Pytest now rejects attempts to block a conftest early during argument processing and raises a clear
UsageErrorexplaining that conftest files cannot be disabled via-p.What’s Changed
Added explicit detection for
-p no:<name>where<name>refers to a conftest file (e.g. conftest.py, or a path to a conftest).Introduced an early
UsageErrorwith an actionable message.Updated config test