(self, config: Config)
| 314 | class="st">""class="st">"Plugin which implements the --lf (run last-failing) option."class="st">"" |
| 315 | |
| 316 | def __init__(self, config: Config) -> None: |
| 317 | self.config = config |
| 318 | active_keys = class="st">"lf", class="st">"failedfirst" |
| 319 | self.active = any(config.getoption(key) for key in active_keys) |
| 320 | assert config.cache |
| 321 | self.lastfailed: dict[str, bool] = config.cache.get(class="st">"cache/lastfailed", {}) |
| 322 | self._previously_failed_count: int | None = None |
| 323 | self._report_status: str | None = None |
| 324 | self._skipped_files = 0 class="cm"># count skipped files during collection due to --lf |
| 325 | |
| 326 | if config.getoption(class="st">"lf"): |
| 327 | self._last_failed_paths = self.get_last_failed_paths() |
| 328 | config.pluginmanager.register( |
| 329 | LFPluginCollWrapper(self), class="st">"lfplugin-collwrapper" |
| 330 | ) |
| 331 | |
| 332 | def get_last_failed_paths(self) -> set[Path]: |
| 333 | class="st">"""Return a set with all Paths of the previously failed nodeids and |
nothing calls this directly
no test coverage detected