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

Method test_get_cache_dir

testing/test_assertrewrite.py:1742–1749  ·  view source on GitHub ↗
(self, monkeypatch, prefix, source, expected)

Source from the content-addressed store, hash-verified

1740 ],
1741 )
1742 def test_get_cache_dir(self, monkeypatch, prefix, source, expected) -> None:
1743 monkeypatch.delenv("PYTHONPYCACHEPREFIX", raising=False)
1744
1745 if prefix is not None and sys.version_info < (3, 8):
1746 pytest.skip("pycache_prefix not available in py<38")
1747 monkeypatch.setattr(sys, "pycache_prefix", prefix, raising=False)
1748
1749 assert get_cache_dir(Path(source)) == Path(expected)
1750
1751 @pytest.mark.skipif(
1752 sys.version_info < (3, 8), reason="pycache_prefix not available in py<38"

Callers

nothing calls this directly

Calls 3

get_cache_dirFunction · 0.90
delenvMethod · 0.80
setattrMethod · 0.80

Tested by

no test coverage detected