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

Method basedir

testing/test_conftest.py:44–55  ·  view source on GitHub ↗
(
        self, request, tmp_path_factory: TempPathFactory
    )

Source from the content-addressed store, hash-verified

42class TestConftestValueAccessGlobal:
43 @pytest.fixture(scope="module", params=["global", "inpackage"])
44 def basedir(
45 self, request, tmp_path_factory: TempPathFactory
46 ) -> Generator[Path, None, None]:
47 tmp_path = tmp_path_factory.mktemp("basedir", numbered=True)
48 tmp_path.joinpath("adir/b").mkdir(parents=True)
49 tmp_path.joinpath("adir/conftest.py").write_text("a=1 ; Directory = 3")
50 tmp_path.joinpath("adir/b/conftest.py").write_text("b=2 ; a = 1.5")
51 if request.param == "inpackage":
52 tmp_path.joinpath("adir/__init__.py").touch()
53 tmp_path.joinpath("adir/b/__init__.py").touch()
54
55 yield tmp_path
56
57 def test_basic_init(self, basedir: Path) -> None:
58 conftest = PytestPluginManager()

Callers

nothing calls this directly

Calls 2

mktempMethod · 0.45
mkdirMethod · 0.45

Tested by

no test coverage detected