Skip to content

Commit a6726ab

Browse files
authored
Merge pull request #9573 from mgorny/backport-9512
Backport #9512 to 6.2.x
2 parents 8c10168 + 2a22b81 commit a6726ab

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

testing/test_config.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,9 +1247,19 @@ def pytest_load_initial_conftests(self):
12471247
m = My()
12481248
pm.register(m)
12491249
hc = pm.hook.pytest_load_initial_conftests
1250-
values = hc._nonwrappers + hc._wrappers
1251-
expected = ["_pytest.config", m.__module__, "_pytest.capture", "_pytest.warnings"]
1252-
assert [x.function.__module__ for x in values] == expected
1250+
hookimpls = [
1251+
(
1252+
hookimpl.function.__module__,
1253+
"wrapper" if hookimpl.hookwrapper else "nonwrapper",
1254+
)
1255+
for hookimpl in hc.get_hookimpls()
1256+
]
1257+
assert hookimpls == [
1258+
("_pytest.config", "nonwrapper"),
1259+
(m.__module__, "nonwrapper"),
1260+
("_pytest.capture", "wrapper"),
1261+
("_pytest.warnings", "wrapper"),
1262+
]
12531263

12541264

12551265
def test_get_plugin_specs_as_list() -> None:

0 commit comments

Comments
 (0)