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

nodes: keep plugins which subclass Item, File working for a bit more #9279

Merged
merged 2 commits into from
Nov 8, 2021

Conversation

bluetech
Copy link
Member

@bluetech bluetech commented Nov 8, 2021

Fix #8435.

@@ -71,7 +71,7 @@ def test_subclassing_both_item_and_collector_deprecated(
),
):

class SoWrong(nodes.File, nodes.Item):
class SoWrong(nodes.Item, nodes.File):
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the order which triggers the crash before this patch, and seems to be more common, so I just switched the test to use it.

For reference, in the plugin corpus I couldn't find any which directly do File, Item, but found these which do Item, File:

pytest-translations/pytest_translations/mo_files.py
11:class MoFileItem(Item, File):

pytest-checkipdb/pytest_checkipdb.py
27:class CheckIpdbItem(pytest.Item, pytest.File):

pytest-todo/todo/plugin.py
22:class TodoItem(pytest.Item, pytest.File):

pytest-isort/pytest_isort/__init__.py
167:class IsortItem(pytest.Item, pytest.File):

pytest-reqs/pytest_reqs.py
122:class ReqsItem(pytest.Item, pytest.File):

pytest-mccabe/pytest_mccabe.py
60:class McCabeItem(pytest.Item, pytest.File):

pytest-yapf/pytest_yapf.py
27:class YapfItem(pytest.Item, pytest.File):

pytest-flake8/pytest_flake8.py
95:class Flake8Item(pytest.Item, pytest.File):

pytest-black/pytest_black.py
45:class BlackItem(pytest.Item, pytest.File):

pytest-eradicate/pytest_eradicate.py
48:class EradicateItem(pytest.Item, pytest.File):

pytest-cram/pytest_cram/__init__.py
50:class CramItem(pytest.Item, pytest.File):

Copy link
Member

@The-Compiler The-Compiler left a comment

Choose a reason for hiding this comment

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

Seems fine to me, thanks for digging into it!

src/_pytest/nodes.py Outdated Show resolved Hide resolved
Co-authored-by: Bruno Oliveira <[email protected]>
@The-Compiler The-Compiler enabled auto-merge (squash) November 8, 2021 14:32
@The-Compiler
Copy link
Member

Took the freedom to apply @nicoddemus' spelling fix suggestion and queue this for merging!

@The-Compiler The-Compiler merged commit f87df9c into pytest-dev:main Nov 8, 2021
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.

Unexpected keyword argument 'path' from plugins
3 participants