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

Delay warning about collector/item diamond inheritance #9646

Merged
merged 1 commit into from Feb 10, 2022

Conversation

nicoddemus
Copy link
Member

This allows that warning to be filtered by filterwarnings.

Fix #9643


# 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()
Copy link
Member Author

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?

Copy link
Member Author

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 ?

Copy link
Member

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

Copy link
Member

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

Copy link
Member Author

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

Pytest 7 not ignoring warnings as instructed on pytest.ini
3 participants