MCPcopy Index your code
hub / github.com/python/mypy / test_junit_fail_two_files

Method test_junit_fail_two_files

mypy/test/testutil.py:66–91  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

64 assert result == expected
65
66 def test_junit_fail_two_files(self) -> None:
67 serious = False
68 messages_by_file: dict[str | None, list[str]] = {
69 "file1.py": ["Test failed", "another line"],
70 "file2.py": ["Another failure", "line 2"],
71 }
72 expected = """<?xml version="1.0" encoding="utf-8"?>
73<testsuite errors="0" failures="2" name="mypy" skips="0" tests="2" time="1.230">
74 <testcase classname="mypy" file="file1.py" line="1" name="mypy-py3.14-test-plat file1.py" time="1.230">
75 <failure message="mypy produced messages">Test failed
76another line</failure>
77 </testcase>
78 <testcase classname="mypy" file="file2.py" line="1" name="mypy-py3.14-test-plat file2.py" time="1.230">
79 <failure message="mypy produced messages">Another failure
80line 2</failure>
81 </testcase>
82</testsuite>
83"""
84 result = _generate_junit_contents(
85 dt=1.23,
86 serious=serious,
87 messages_by_file=messages_by_file,
88 version="3.14",
89 platform="test-plat",
90 )
91 assert result == expected
92
93 def test_serious_error(self) -> None:
94 serious = True

Callers

nothing calls this directly

Calls 1

_generate_junit_contentsFunction · 0.90

Tested by

no test coverage detected