-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Delay warning about collector/item diamond inheritance #9646
Conversation
src/_pytest/nodes.py
Outdated
|
||
# Set of node types to avoid issuing a diamond inheritance warning | ||
# for the same class more than once, which is not helpful. | ||
_DIAMOND_COLLECTOR_WARNING: ClassVar[Set[Type["Item"]]] = set() |
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.
Not sure we want this, might be better to just let we issue multiple warnings and let users filter them. Thoughts?
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.
Any thoughts on this particular aspect? @RonnyPfannschmidt @The-Compiler ?
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.
"classically" warnings once filters should sort that, however as we cant rely on them like wed like, i think its fine to do this hack
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.
@nicoddemus we might however use a boolean on each individual type instance instead of the set in the base class
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.
Will do. 👍
This allows that warning to be filtered by `filterwarnings`. Fix pytest-dev#9643
9b209a1
to
88c3512
Compare
This allows that warning to be filtered by
filterwarnings
.Fix #9643