Skip to content

Commit

Permalink
Merge pull request pytest-dev#9513 from pytest-dev/backport-9512-to-7…
Browse files Browse the repository at this point in the history
….0.x

[7.0.x] testing: avoid private pluggy attributes in test
  • Loading branch information
bluetech committed Jan 14, 2022
2 parents 46c06e7 + a1635ca commit 5c49dea
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions testing/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1264,15 +1264,20 @@ def pytest_load_initial_conftests(self):
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"),
]


Expand Down

0 comments on commit 5c49dea

Please sign in to comment.