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

Function test_unicode_issue368

testing/test_junitxml.py:1243–1270  ·  testing/test_junitxml.py::test_unicode_issue368
(pytester: Pytester)

Source from the content-addressed store, hash-verified

1241
1242
1243def test_unicode_issue368(pytester: Pytester) -> None:
1244 path = pytester.path.joinpath(class="st">"test.xml")
1245 log = LogXML(str(path), None)
1246 ustr = class="st">"ВНИ!"
1247
1248 class Report(BaseReport):
1249 longrepr = ustr
1250 sections: list[tuple[str, str]] = []
1251 nodeid = class="st">"something"
1252 location = class="st">"tests/filename.py", 42, class="st">"TestClass.method"
1253 when = class="st">"teardown"
1254
1255 test_report = cast(TestReport, Report())
1256
1257 class="cm"># hopefully this is not too brittle ...
1258 log.pytest_sessionstart()
1259 node_reporter = log._opentestcase(test_report)
1260 node_reporter.append_failure(test_report)
1261 node_reporter.append_collect_error(test_report)
1262 node_reporter.append_collect_skipped(test_report)
1263 node_reporter.append_error(test_report)
1264 test_report.longrepr = class="st">"filename", 1, ustr
1265 node_reporter.append_skipped(test_report)
1266 test_report.longrepr = class="st">"filename", 1, class="st">"Skipped: 卡嘣嘣"
1267 node_reporter.append_skipped(test_report)
1268 test_report.wasxfail = ustr
1269 node_reporter.append_skipped(test_report)
1270 log.pytest_sessionfinish()
1271
1272
1273def test_record_property(pytester: Pytester, run_and_parse: RunAndParse) -> None:

Callers

nothing calls this directly

Calls 10

pytest_sessionstartMethod · 0.95
_opentestcaseMethod · 0.95
pytest_sessionfinishMethod · 0.95
LogXMLClass · 0.90
ReportClass · 0.85
append_failureMethod · 0.80
append_collect_errorMethod · 0.80
append_errorMethod · 0.80
append_skippedMethod · 0.80

Tested by

no test coverage detected