(self, config: Config)
| 283 | """Plugin which implements the --lf (run last-failing) option.""" |
| 284 | |
| 285 | def __init__(self, config: Config) -> None: |
| 286 | self.config = config |
| 287 | active_keys = "lf", "failedfirst" |
| 288 | self.active = any(config.getoption(key) for key in active_keys) |
| 289 | assert config.cache |
| 290 | self.lastfailed: Dict[str, bool] = config.cache.get("cache/lastfailed", {}) |
| 291 | self._previously_failed_count: Optional[int] = None |
| 292 | self._report_status: Optional[str] = None |
| 293 | self._skipped_files = 0 # count skipped files during collection due to --lf |
| 294 | |
| 295 | if config.getoption("lf"): |
| 296 | self._last_failed_paths = self.get_last_failed_paths() |
| 297 | config.pluginmanager.register( |
| 298 | LFPluginCollWrapper(self), "lfplugin-collwrapper" |
| 299 | ) |
| 300 | |
| 301 | def get_last_failed_paths(self) -> Set[Path]: |
| 302 | """Return a set with all Paths()s of the previously failed nodeids.""" |
nothing calls this directly
no test coverage detected