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

Function test_cache_reportheader

testing/test_cacheprovider.py:200–211  ·  view source on GitHub ↗
(
    env: Sequence[str], pytester: Pytester, monkeypatch: MonkeyPatch
)

Source from the content-addressed store, hash-verified

198
199@pytest.mark.parametrize("env", ((), ("TOX_ENV_DIR", "mydir/tox-env")))
200def test_cache_reportheader(
201 env: Sequence[str], pytester: Pytester, monkeypatch: MonkeyPatch
202) -> None:
203 pytester.makepyfile("""def test_foo(): pass""")
204 if env:
205 monkeypatch.setenv(*env)
206 expected = os.path.join(env[1], ".pytest_cache")
207 else:
208 monkeypatch.delenv("TOX_ENV_DIR", raising=False)
209 expected = ".pytest_cache"
210 result = pytester.runpytest("-v")
211 result.stdout.fnmatch_lines([f"cachedir: {expected}"])
212
213
214def test_cache_reportheader_external_abspath(

Callers

nothing calls this directly

Calls 6

setenvMethod · 0.80
joinMethod · 0.80
delenvMethod · 0.80
fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected