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

Function test_unicode_issue368

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

Source from the content-addressed store, hash-verified

1241
1242
1243def test_unicode_issue368(pytester: Pytester) -> None:
1244 path = pytester.path.joinpath("test.xml")
1245 log = LogXML(str(path), None)
1246 ustr = "ВНИ!"
1247
1248 class Report(BaseReport):
1249 longrepr = ustr
1250 sections: list[tuple[str, str]] = []
1251 nodeid = "something"
1252 location = "tests/filename.py", 42, "TestClass.method"
1253 when = "teardown"
1254
1255 test_report = cast(TestReport, Report())
1256
1257 # 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 = "filename", 1, ustr
1265 node_reporter.append_skipped(test_report)
1266 test_report.longrepr = "filename", 1, "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

Used in the wild real call sites across dependent graphs

searching dependent graphs…