Create the Cache instance for a Config. :meta private:
(cls, config: Config, *, _ispytest: bool = False)
| 109 | |
| 110 | @classmethod |
| 111 | def for_config(cls, config: Config, *, _ispytest: bool = False) -> Cache: |
| 112 | """Create the Cache instance for a Config. |
| 113 | |
| 114 | :meta private: |
| 115 | """ |
| 116 | check_ispytest(_ispytest) |
| 117 | cachedir = cls.cache_dir_from_config(config, _ispytest=True) |
| 118 | if config.getoption("cacheclear") and cachedir.is_dir(): |
| 119 | cls.clear_cache(cachedir, _ispytest=True) |
| 120 | return cls(cachedir, config, _ispytest=True) |
| 121 | |
| 122 | @classmethod |
| 123 | def clear_cache(cls, cachedir: Path, _ispytest: bool = False) -> None: |