MCPcopy
hub / github.com/pytest-dev/pytest / test_custom_abs_cache_dir

Method test_custom_abs_cache_dir

testing/test_cacheprovider.py:169–182  ·  view source on GitHub ↗
(
        self, pytester: Pytester, tmp_path_factory: TempPathFactory
    )

Source from the content-addressed store, hash-verified

167 assert pytester.path.joinpath(rel_cache_dir).is_dir()
168
169 def test_custom_abs_cache_dir(
170 self, pytester: Pytester, tmp_path_factory: TempPathFactory
171 ) -> None:
172 tmp = tmp_path_factory.mktemp("tmp")
173 abs_cache_dir = tmp / "custom_cache_dir"
174 pytester.makeini(
175 f"""
176 [pytest]
177 cache_dir = {abs_cache_dir}
178 """
179 )
180 pytester.makepyfile(test_errored="def test_error():\n assert False")
181 pytester.runpytest()
182 assert abs_cache_dir.is_dir()
183
184 def test_custom_cache_dir_with_env_var(
185 self, pytester: Pytester, monkeypatch: MonkeyPatch

Callers

nothing calls this directly

Calls 4

mktempMethod · 0.45
makeiniMethod · 0.45
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected