diff --git a/docs/changelog/2649.bugfix.rst b/docs/changelog/2649.bugfix.rst new file mode 100644 index 000000000..32cbb383c --- /dev/null +++ b/docs/changelog/2649.bugfix.rst @@ -0,0 +1 @@ +Use get_hookimpls method instead of the private attribute in tests. diff --git a/tests/conftest.py b/tests/conftest.py index 1175aa952..bec6d8f00 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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__))