(self)
| 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 |
| 76 | another 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 |
| 80 | line 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 |
nothing calls this directly
no test coverage detected