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

Method append_failure

src/_pytest/junitxml.py:191–205  ·  view source on GitHub ↗
(self, report: TestReport)

Source from the content-addressed store, hash-verified

189 self.add_stats("passed")
190
191 def append_failure(self, report: TestReport) -> None:
192 # msg = str(report.longrepr.reprtraceback.extraline)
193 if hasattr(report, "wasxfail"):
194 self._add_simple("skipped", "xfail-marked test passes unexpectedly")
195 else:
196 assert report.longrepr is not None
197 reprcrash: ReprFileLocation | None = getattr(
198 report.longrepr, "reprcrash", None
199 )
200 if reprcrash is not None:
201 message = reprcrash.message
202 else:
203 message = str(report.longrepr)
204 message = bin_xml_escape(message)
205 self._add_simple("failure", message, str(report.longrepr))
206
207 def append_collect_error(self, report: TestReport) -> None:
208 # msg = str(report.longrepr.reprtraceback.extraline)

Callers 3

test_unicode_issue368Function · 0.80
test_url_propertyFunction · 0.80

Calls 2

_add_simpleMethod · 0.95
bin_xml_escapeFunction · 0.85

Tested by 2

test_unicode_issue368Function · 0.64
test_url_propertyFunction · 0.64