From a1635ca49a9d239658284e3767a352a41781fc85 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 14 Jan 2022 18:09:10 +0200 Subject: [PATCH] [7.0.x] testing: avoid private pluggy attributes in test --- testing/test_config.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/testing/test_config.py b/testing/test_config.py index c8e21a847..bf4b2741e 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -1264,15 +1264,20 @@ def test_load_initial_conftest_last_ordering(_config_for_test): m = My() pm.register(m) hc = pm.hook.pytest_load_initial_conftests - assert [x.function.__module__ for x in hc._nonwrappers] == [ - "_pytest.config", - m.__module__, - "_pytest.legacypath", - "_pytest.pythonpath", + hookimpls = [ + ( + hookimpl.function.__module__, + "wrapper" if hookimpl.hookwrapper else "nonwrapper", + ) + for hookimpl in hc.get_hookimpls() ] - assert [x.function.__module__ for x in hc._wrappers] == [ - "_pytest.capture", - "_pytest.warnings", + assert hookimpls == [ + ("_pytest.config", "nonwrapper"), + (m.__module__, "nonwrapper"), + ("_pytest.legacypath", "nonwrapper"), + ("_pytest.pythonpath", "nonwrapper"), + ("_pytest.capture", "wrapper"), + ("_pytest.warnings", "wrapper"), ]