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

Method append_error

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

Source from the content-addressed store, hash-verified

218 self._add_simple("skipped", "collection skipped", str(report.longrepr))
219
220 def append_error(self, report: TestReport) -> None:
221 assert report.longrepr is not None
222 reprcrash: Optional[ReprFileLocation] = getattr(
223 report.longrepr, "reprcrash", None
224 )
225 if reprcrash is not None:
226 reason = reprcrash.message
227 else:
228 reason = str(report.longrepr)
229
230 if report.when == "teardown":
231 msg = f'failed on teardown with "{reason}"'
232 else:
233 msg = f'failed on setup with "{reason}"'
234 self._add_simple("error", msg, str(report.longrepr))
235
236 def append_skipped(self, report: TestReport) -> None:
237 if hasattr(report, "wasxfail"):

Callers 2

test_unicode_issue368Function · 0.80

Calls 1

_add_simpleMethod · 0.95

Tested by 1

test_unicode_issue368Function · 0.64