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

Method _from_json

src/_pytest/reports.py:232–242  ·  view source on GitHub ↗

Create either a TestReport or CollectReport, depending on the calling class. It is the callers responsibility to know which class to pass here. This was originally the serialize_report() function from xdist (ca03269). Experimental method.

(cls, reportdict: dict[str, object])

Source from the content-addressed store, hash-verified

230
231 @classmethod
232 def _from_json(cls, reportdict: dict[str, object]) -> Self:
233 """Create either a TestReport or CollectReport, depending on the calling class.
234
235 It is the callers responsibility to know which class to pass here.
236
237 This was originally the serialize_report() function from xdist (ca03269).
238
239 Experimental method.
240 """
241 kwargs = _report_kwargs_from_json(reportdict)
242 return cls(**kwargs)
243
244
245def _report_unserialization_failure(

Calls 2

_report_kwargs_from_jsonFunction · 0.85
clsFunction · 0.85