Skip to content

Commit

Permalink
[test] Use get_hookimpls method instead of the private attribute (#2649)
Browse files Browse the repository at this point in the history
  • Loading branch information
danigm committed Oct 20, 2023
1 parent 97b3060 commit b82dd32
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/changelog/2649.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use get_hookimpls method instead of the private attribute in tests.
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 b82dd32

Please sign in to comment.