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

Method clear_cache

src/_pytest/cacheprovider.py:123–132  ·  view source on GitHub ↗

Clear the sub-directories used to hold cached directories and values. :meta private:

(cls, cachedir: Path, _ispytest: bool = False)

Source from the content-addressed store, hash-verified

121
122 @classmethod
123 def clear_cache(cls, cachedir: Path, _ispytest: bool = False) -> None:
124 """Clear the sub-directories used to hold cached directories and values.
125
126 :meta private:
127 """
128 check_ispytest(_ispytest)
129 for prefix in (cls._CACHE_PREFIX_DIRS, cls._CACHE_PREFIX_VALUES):
130 d = cachedir / prefix
131 if d.is_dir():
132 rm_rf(d)
133
134 @staticmethod
135 def cache_dir_from_config(config: Config, *, _ispytest: bool = False) -> Path:

Callers 1

for_configMethod · 0.80

Calls 2

check_ispytestFunction · 0.90
rm_rfFunction · 0.85

Tested by

no test coverage detected