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

Function test_unicode_issue368

testing/test_junitxml.py:1181–1208  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

1179
1180
1181def test_unicode_issue368(pytester: Pytester) -> None:
1182 path = pytester.path.joinpath("test.xml")
1183 log = LogXML(str(path), None)
1184 ustr = "ВНИ!"
1185
1186 class Report(BaseReport):
1187 longrepr = ustr
1188 sections: List[Tuple[str, str]] = []
1189 nodeid = "something"
1190 location = "tests/filename.py", 42, "TestClass.method"
1191 when = "teardown"
1192
1193 test_report = cast(TestReport, Report())
1194
1195 # hopefully this is not too brittle ...
1196 log.pytest_sessionstart()
1197 node_reporter = log._opentestcase(test_report)
1198 node_reporter.append_failure(test_report)
1199 node_reporter.append_collect_error(test_report)
1200 node_reporter.append_collect_skipped(test_report)
1201 node_reporter.append_error(test_report)
1202 test_report.longrepr = "filename", 1, ustr
1203 node_reporter.append_skipped(test_report)
1204 test_report.longrepr = "filename", 1, "Skipped: 卡嘣嘣"
1205 node_reporter.append_skipped(test_report)
1206 test_report.wasxfail = ustr # type: ignore[attr-defined]
1207 node_reporter.append_skipped(test_report)
1208 log.pytest_sessionfinish()
1209
1210
1211def 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