(path)
| 140 | @pytest.mark.skipif(NO_MYPY, reason="Mypy is not installed") |
| 141 | @pytest.mark.parametrize("path", get_test_cases(PASS_DIR, FAIL_DIR)) |
| 142 | def test_pass(path) -> None: |
| 143 | # Alias `OUTPUT_MYPY` so that it appears in the local namespace |
| 144 | output_mypy = OUTPUT_MYPY |
| 145 | |
| 146 | if path not in output_mypy: |
| 147 | return |
| 148 | |
| 149 | relpath = os.path.relpath(path) |
| 150 | |
| 151 | # collect any reported errors, and clean up the output |
| 152 | messages = [] |
| 153 | for message in output_mypy[path]: |
| 154 | lineno, content = _strip_filename(message) |
| 155 | content = content.removeprefix("error:").lstrip() |
| 156 | messages.append(f"{relpath}:{lineno} - {content}") |
| 157 | |
| 158 | if messages: |
| 159 | pytest.fail("\n".join(messages), pytrace=False) |
| 160 | |
| 161 | |
| 162 | @pytest.mark.slow |
nothing calls this directly
no test coverage detected
searching dependent graphs…