Skip to content

Commit

Permalink
[test] Use get_hookimpls method instead of the private attribute dire…
Browse files Browse the repository at this point in the history
…ctly
  • Loading branch information
danigm committed Oct 3, 2023
1 parent 97b3060 commit c4772eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def pytest_configure(config):
"""Ensure randomly is called before we re-order"""
manager = config.pluginmanager

order = manager.hook.pytest_collection_modifyitems._hookimpls # noqa: SLF001
order = manager.hook.pytest_collection_modifyitems.get_hookimpls()
dest = next((i for i, p in enumerate(order) if p.plugin is manager.getplugin("randomly")), None)
if dest is not None:
from_pos = next(i for i, p in enumerate(order) if p.plugin is manager.getplugin(__file__))
Expand Down

0 comments on commit c4772eb

Please sign in to comment.