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

Method warn

src/_pytest/cacheprovider.py:143–157  ·  src/_pytest/cacheprovider.py::Cache.warn

Issue a cache warning. :meta private:

(self, fmt: str, *, _ispytest: bool = False, **args: object)

Source from the content-addressed store, hash-verified

141 return resolve_from_str(config.getini(class="st">"cache_dir"), config.rootpath)
142
143 def warn(self, fmt: str, *, _ispytest: bool = False, **args: object) -> None:
144 class="st">"""Issue a cache warning.
145
146 :meta private:
147 class="st">"""
148 check_ispytest(_ispytest)
149 import warnings
150
151 from _pytest.warning_types import PytestCacheWarning
152
153 warnings.warn(
154 PytestCacheWarning(fmt.format(**args) if args else fmt),
155 self._config.hook,
156 stacklevel=3,
157 )
158
159 def _mkdir(self, path: Path) -> None:
160 self._ensure_cache_dir_and_supporting_files()

Callers 1

setMethod · 0.95

Calls 3

check_ispytestFunction · 0.90
PytestCacheWarningClass · 0.90
formatMethod · 0.45

Tested by

no test coverage detected