Skip to content

Commit 6a0a7c2

Browse files
committed
fix(tests): Adapt PEP561Suite to default to non-pretty output
This commit adapts the `PEP561Suite` test runner to handle the new pretty-by-default behavior. The `parse_mypy_args` helper in `mypy/test/testpep561.py` is modified to inject the `--no-pretty` flag into the arguments parsed from '# flags:' lines in test cases. Part of #19108.
1 parent 0845787 commit 6a0a7c2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mypy/test/testpep561.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,5 +174,8 @@ def parse_pkgs(comment: str) -> tuple[list[str], list[str]]:
174174
def parse_mypy_args(line: str) -> list[str]:
175175
m = re.match("# flags: (.*)$", line)
176176
if not m:
177-
return [] # No args; mypy will spit out an error.
178-
return m.group(1).split()
177+
return ['--no-pretty'] # No args; mypy will spit out an error.
178+
args = m.group(1).split()
179+
args.append('--no-pretty')
180+
181+
return args

0 commit comments

Comments
 (0)