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

Method test_cachefuncarg

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

Source from the content-addressed store, hash-verified

112 result.stdout.fnmatch_lines(["*1 passed*"])
113
114 def test_cachefuncarg(self, pytester: Pytester) -> None:
115 pytester.makepyfile(
116 """
117 import pytest
118 def test_cachefuncarg(cache):
119 val = cache.get("some/thing", None)
120 assert val is None
121 cache.set("some/thing", [1])
122 pytest.raises(TypeError, lambda: cache.get("some/thing"))
123 val = cache.get("some/thing", [])
124 assert val == [1]
125 """
126 )
127 result = pytester.runpytest()
128 assert result.ret == 0
129 result.stdout.fnmatch_lines(["*1 passed*"])
130
131 def test_custom_rel_cache_dir(self, pytester: Pytester) -> None:
132 rel_cache_dir = os.path.join("custom_cache_dir", "subdir")

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected