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

Method _load_cached_info

src/_pytest/stepwise.py:110–124  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

108 self.cached_info = self._load_cached_info()
109
110 def _load_cached_info(self) -> StepwiseCacheInfo:
111 cached_dict: dict[str, Any] | None = self.cache.get(STEPWISE_CACHE_DIR, None)
112 if cached_dict:
113 try:
114 return StepwiseCacheInfo(
115 cached_dict["last_failed"],
116 cached_dict["last_test_count"],
117 cached_dict["last_cache_date_str"],
118 )
119 except (KeyError, TypeError) as e:
120 error = f"{type(e).__name__}: {e}"
121 self.report_status.append(f"error reading cache, discarding ({error})")
122
123 # Cache not found or error during load, return a new cache.
124 return StepwiseCacheInfo.empty()
125
126 def pytest_sessionstart(self, session: Session) -> None:
127 self.session = session

Callers 1

__init__Method · 0.95

Calls 4

StepwiseCacheInfoClass · 0.85
appendMethod · 0.80
emptyMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected