MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_getconftest_pathlist

Method test_getconftest_pathlist

testing/test_config.py:595–611  ·  view source on GitHub ↗
(self, pytester: Pytester, tmp_path: Path)

Source from the content-addressed store, hash-verified

593 assert config.getoption("x", 1) == 1
594
595 def test_getconftest_pathlist(self, pytester: Pytester, tmp_path: Path) -> None:
596 somepath = tmp_path.joinpath("x", "y", "z")
597 p = tmp_path.joinpath("conftest.py")
598 p.write_text(f"mylist = {['.', str(somepath)]}")
599 config = pytester.parseconfigure(p)
600 assert (
601 config._getconftest_pathlist("notexist", path=tmp_path, rootpath=tmp_path)
602 is None
603 )
604 pl = (
605 config._getconftest_pathlist("mylist", path=tmp_path, rootpath=tmp_path)
606 or []
607 )
608 print(pl)
609 assert len(pl) == 2
610 assert pl[0] == tmp_path
611 assert pl[1] == somepath
612
613 @pytest.mark.parametrize("maybe_type", ["not passed", "None", '"string"'])
614 def test_addini(self, pytester: Pytester, maybe_type: str) -> None:

Callers

nothing calls this directly

Calls 2

_getconftest_pathlistMethod · 0.80
parseconfigureMethod · 0.45

Tested by

no test coverage detected