|  | 
| 12 | 12 | from collections.abc import Iterator | 
| 13 | 13 | from typing import Any, Callable | 
| 14 | 14 | 
 | 
|  | 15 | +from pytest import raises | 
|  | 16 | + | 
| 15 | 17 | import mypy.stubtest | 
| 16 | 18 | from mypy import build, nodes | 
| 17 | 19 | from mypy.modulefinder import BuildSource | 
| 18 | 20 | from mypy.options import Options | 
| 19 | 21 | from mypy.stubtest import parse_options, test_stubs | 
| 20 | 22 | from mypy.test.config import test_temp_dir | 
| 21 | 23 | from mypy.test.data import root_dir | 
| 22 |  | -from pytest import raises | 
| 23 | 24 | 
 | 
| 24 | 25 | 
 | 
| 25 | 26 | @contextlib.contextmanager | 
| @@ -172,7 +173,12 @@ def build_helper(source: str) -> build.BuildResult: | 
| 172 | 173 | 
 | 
| 173 | 174 | 
 | 
| 174 | 175 | def run_stubtest_with_stderr( | 
| 175 |  | -    stub: str, runtime: str, options: list[str], config_file: str | None = None, output: io.StringIO | None = None, outerr: io.StringIO | None = None | 
|  | 176 | +    stub: str, | 
|  | 177 | +    runtime: str, | 
|  | 178 | +    options: list[str], | 
|  | 179 | +    config_file: str | None = None, | 
|  | 180 | +    output: io.StringIO | None = None, | 
|  | 181 | +    outerr: io.StringIO | None = None, | 
| 176 | 182 | ) -> tuple[str, str]: | 
| 177 | 183 |     with use_tmp_dir(TEST_MODULE_NAME) as tmp_dir: | 
| 178 | 184 |         with open("builtins.pyi", "w") as f: | 
| @@ -2893,7 +2899,12 @@ def test_config_file_error_codes_invalid(self) -> None: | 
| 2893 | 2899 |         outerr = io.StringIO() | 
| 2894 | 2900 |         with raises(SystemExit): | 
| 2895 | 2901 |             run_stubtest_with_stderr( | 
| 2896 |  | -                stub=stub, runtime=runtime, options=[], config_file=config_file, output=output, outerr=outerr | 
|  | 2902 | +                stub=stub, | 
|  | 2903 | +                runtime=runtime, | 
|  | 2904 | +                options=[], | 
|  | 2905 | +                config_file=config_file, | 
|  | 2906 | +                output=output, | 
|  | 2907 | +                outerr=outerr, | 
| 2897 | 2908 |             ) | 
| 2898 | 2909 | 
 | 
| 2899 | 2910 |         assert output.getvalue() == "error: Invalid error code(s): not-a-valid-name\n" | 
|  | 
0 commit comments