MCPcopy Create free account
hub / github.com/pytest-dev/pytest-bdd / serialize

Method serialize

src/pytest_bdd/reporting.py:37–50  ·  view source on GitHub ↗

Serialize the step execution report. :return: Serialized step execution report. :rtype: dict

(self)

Source from the content-addressed store, hash-verified

35 self.started = time.perf_counter()
36
37 def serialize(self) -> dict[str, Any]:
38 """Serialize the step execution report.
39
40 :return: Serialized step execution report.
41 :rtype: dict
42 """
43 return {
44 "name": self.step.name,
45 "type": self.step.type,
46 "keyword": self.step.keyword,
47 "line_number": self.step.line_number,
48 "failed": self.failed,
49 "duration": self.duration,
50 }
51
52 def finalize(self, failed: bool) -> None:
53 """Stop collecting information and finalize the report.

Callers 2

serializeMethod · 0.45
runtest_makereportFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected