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

Method test_config_cache_dataerror

testing/test_cacheprovider.py:27–36  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

25 assert p.is_dir()
26
27 def test_config_cache_dataerror(self, pytester: Pytester) -> None:
28 pytester.makeini("[pytest]")
29 config = pytester.parseconfigure()
30 assert config.cache is not None
31 cache = config.cache
32 pytest.raises(TypeError, lambda: cache.set("key/name", cache))
33 config.cache.set("key/name", 0)
34 config.cache._getvaluepath("key/name").write_bytes(b"123invalid")
35 val = config.cache.get("key/name", -2)
36 assert val == -2
37
38 @pytest.mark.filterwarnings("ignore:could not create cache path")
39 def test_cache_writefail_cachfile_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