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

Method test_custom_abs_cache_dir

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

Source from the content-addressed store, hash-verified

143 assert pytester.path.joinpath(rel_cache_dir).is_dir()
144
145 def test_custom_abs_cache_dir(
146 self, pytester: Pytester, tmp_path_factory: TempPathFactory
147 ) -> None:
148 tmp = tmp_path_factory.mktemp("tmp")
149 abs_cache_dir = tmp / "custom_cache_dir"
150 pytester.makeini(
151 """
152 [pytest]
153 cache_dir = {cache_dir}
154 """.format(
155 cache_dir=abs_cache_dir
156 )
157 )
158 pytester.makepyfile(test_errored="def test_error():\n assert False")
159 pytester.runpytest()
160 assert abs_cache_dir.is_dir()
161
162 def test_custom_cache_dir_with_env_var(
163 self, pytester: Pytester, monkeypatch: MonkeyPatch

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected