Create the Cache instance for a Config. :meta private:
(cls, config: Config, *, _ispytest: bool = False)
| 73 | |
| 74 | @classmethod |
| 75 | def for_config(cls, config: Config, *, _ispytest: bool = False) -> "Cache": |
| 76 | """Create the Cache instance for a Config. |
| 77 | |
| 78 | :meta private: |
| 79 | """ |
| 80 | check_ispytest(_ispytest) |
| 81 | cachedir = cls.cache_dir_from_config(config, _ispytest=True) |
| 82 | if config.getoption("cacheclear") and cachedir.is_dir(): |
| 83 | cls.clear_cache(cachedir, _ispytest=True) |
| 84 | return cls(cachedir, config, _ispytest=True) |
| 85 | |
| 86 | @classmethod |
| 87 | def clear_cache(cls, cachedir: Path, _ispytest: bool = False) -> None: |