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

Method append_error

src/_pytest/junitxml.py:215–227  ·  src/_pytest/junitxml.py::_NodeReporter.append_error
(self, report: TestReport)

Source from the content-addressed store, hash-verified

213 self._add_simple(class="st">"skipped", class="st">"collection skipped", str(report.longrepr))
214
215 def append_error(self, report: TestReport) -> None:
216 assert report.longrepr is not None
217 reprcrash: ReprFileLocation | None = getattr(report.longrepr, class="st">"reprcrash", None)
218 if reprcrash is not None:
219 reason = reprcrash.message
220 else:
221 reason = str(report.longrepr)
222
223 if report.when == class="st">"teardown":
224 msg = f&class="cm">#x27;failed on teardown with class="st">"{reason}"'
225 else:
226 msg = f&class="cm">#x27;failed on setup with class="st">"{reason}"'
227 self._add_simple(class="st">"error", bin_xml_escape(msg), str(report.longrepr))
228
229 def append_skipped(self, report: TestReport) -> None:
230 if hasattr(report, class="st">"wasxfail"):

Callers 2

test_unicode_issue368Function · 0.80

Calls 2

_add_simpleMethod · 0.95
bin_xml_escapeFunction · 0.85

Tested by 1

test_unicode_issue368Function · 0.64