MCPcopy
hub / github.com/pytest-dev/pytest / __init__

Method __init__

src/_pytest/cacheprovider.py:316–330  ·  src/_pytest/cacheprovider.py::LFPlugin.__init__
(self, config: Config)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

get_last_failed_pathsMethod · 0.95
LFPluginCollWrapperClass · 0.85
getoptionMethod · 0.80
registerMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected