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

Method clear_cache

src/_pytest/cacheprovider.py:87–96  ·  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

85
86 @classmethod
87 def clear_cache(cls, cachedir: Path, _ispytest: bool = False) -> None:
88 """Clear the sub-directories used to hold cached directories and values.
89
90 :meta private:
91 """
92 check_ispytest(_ispytest)
93 for prefix in (cls._CACHE_PREFIX_DIRS, cls._CACHE_PREFIX_VALUES):
94 d = cachedir / prefix
95 if d.is_dir():
96 rm_rf(d)
97
98 @staticmethod
99 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