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

Method warn

src/_pytest/cacheprovider.py:107–120  ·  view source on GitHub ↗

Issue a cache warning. :meta private:

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

Source from the content-addressed store, hash-verified

105 return resolve_from_str(config.getini("cache_dir"), config.rootpath)
106
107 def warn(self, fmt: str, *, _ispytest: bool = False, **args: object) -> None:
108 """Issue a cache warning.
109
110 :meta private:
111 """
112 check_ispytest(_ispytest)
113 import warnings
114 from _pytest.warning_types import PytestCacheWarning
115
116 warnings.warn(
117 PytestCacheWarning(fmt.format(**args) if args else fmt),
118 self._config.hook,
119 stacklevel=3,
120 )
121
122 def mkdir(self, name: str) -> Path:
123 """Return a directory path object with the given name.

Callers 1

setMethod · 0.95

Calls 3

check_ispytestFunction · 0.90
PytestCacheWarningClass · 0.90
formatMethod · 0.45

Tested by

no test coverage detected