Skip to content
Prev Previous commit
Next Next commit
Fix linting
  • Loading branch information
nicoddemus committed Apr 2, 2021
commit 2c87a26ba488686f7d79cf3a50604daafff5a72e
4 changes: 3 additions & 1 deletion src/_pytest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,9 @@ def gethookproxy(self, fspath: "os.PathLike[str]"):
# hooks with all conftest.py files.
pm = self.config.pluginmanager
my_conftestmodules = pm._getconftestmodules(
Path(fspath), self.config.getoption("importmode"), rootpath=self.config.rootpath
Path(fspath),
self.config.getoption("importmode"),
rootpath=self.config.rootpath,
)
remove_mods = pm._conftest_plugins.difference(my_conftestmodules)
if remove_mods:
Expand Down
10 changes: 8 additions & 2 deletions testing/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,14 @@ def test_getconftest_pathlist(self, pytester: Pytester, tmp_path: Path) -> None:
p = tmp_path.joinpath("conftest.py")
p.write_text(f"pathlist = ['.', {str(somepath)!r}]")
config = pytester.parseconfigure(p)
assert config._getconftest_pathlist("notexist", path=tmp_path, rootpath=tmp_path) is None
pl = config._getconftest_pathlist("pathlist", path=tmp_path, rootpath=tmp_path) or []
assert (
config._getconftest_pathlist("notexist", path=tmp_path, rootpath=tmp_path)
is None
)
pl = (
config._getconftest_pathlist("pathlist", path=tmp_path, rootpath=tmp_path)
or []
)
print(pl)
assert len(pl) == 2
assert pl[0] == tmp_path
Expand Down