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

Method test_config_cache_dataerror

testing/test_cacheprovider.py:49–59  ·  testing/test_cacheprovider.py::TestNewAPI.test_config_cache_dataerror
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

47 assert (p.parent.stat().st_mode & 0o777) == (p.stat().st_mode & 0o777)
48
49 def test_config_cache_dataerror(self, pytester: Pytester) -> None:
50 pytester.makeini(class="st">"[pytest]")
51 config = pytester.parseconfigure()
52 assert config.cache is not None
53 cache = config.cache
54 with pytest.raises(TypeError):
55 cache.set(class="st">"key/name", cache)
56 config.cache.set(class="st">"key/name", 0)
57 config.cache._getvaluepath(class="st">"key/name").write_bytes(bclass="st">"123invalid")
58 val = config.cache.get(class="st">"key/name", -2)
59 assert val == -2
60
61 @pytest.mark.filterwarnings(class="st">"ignore:could not create cache path")
62 def test_cache_writefail_cachefile_silent(self, pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 5

setMethod · 0.80
_getvaluepathMethod · 0.80
makeiniMethod · 0.45
parseconfigureMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected