config: split _getconftestmodules and _loadconftestmodules
Previously, the `_getconftestmodules` function was used both to load conftest modules for a path (during `pytest_load_initial_conftests`), and to retrieve conftest modules for a path (during hook dispatch and for fetching `collect_ignore`). This made things muddy - it is usually nicer to have clear separation between "command" and "query" functions, when they occur in separate phases. So split into "load" and "get". Currently, `gethookproxy` still loads conftest itself. I hope to change this in the future.
This commit is contained in:
@@ -2103,9 +2103,7 @@ class TestAutouseManagement:
|
||||
reprec = pytester.inline_run("-v", "-s", "--confcutdir", pytester.path)
|
||||
reprec.assertoutcome(passed=8)
|
||||
config = reprec.getcalls("pytest_unconfigure")[0].config
|
||||
values = config.pluginmanager._getconftestmodules(
|
||||
p, importmode="prepend", rootpath=pytester.path
|
||||
)[0].values
|
||||
values = config.pluginmanager._getconftestmodules(p)[0].values
|
||||
assert values == ["fin_a1", "fin_a2", "fin_b1", "fin_b2"] * 2
|
||||
|
||||
def test_scope_ordering(self, pytester: Pytester) -> None:
|
||||
|
||||
Reference in New Issue
Block a user