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

Method append_failure

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

Source from the content-addressed store, hash-verified

194 self.add_stats("passed")
195
196 def append_failure(self, report: TestReport) -> None:
197 # msg = str(report.longrepr.reprtraceback.extraline)
198 if hasattr(report, "wasxfail"):
199 self._add_simple("skipped", "xfail-marked test passes unexpectedly")
200 else:
201 assert report.longrepr is not None
202 reprcrash: Optional[ReprFileLocation] = getattr(
203 report.longrepr, "reprcrash", None
204 )
205 if reprcrash is not None:
206 message = reprcrash.message
207 else:
208 message = str(report.longrepr)
209 message = bin_xml_escape(message)
210 self._add_simple("failure", message, str(report.longrepr))
211
212 def append_collect_error(self, report: TestReport) -> None:
213 # 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