Properly handle newlines in diagnostic error tests

This is necessary to ensure that the output can be compared directly.
This commit is contained in:
Pradyun Gedam 2021-12-03 15:06:44 +00:00
parent 6a20f5b056
commit e857d0f532
No known key found for this signature in database
GPG Key ID: FF99710C4332258E
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ def rendered_in_ascii(error: DiagnosticPipError, *, color: bool = False) -> str:
with io.BytesIO() as stream:
console = rich.console.Console(
force_terminal=False,
file=io.TextIOWrapper(stream, encoding="ascii"),
file=io.TextIOWrapper(stream, encoding="ascii", newline=""),
color_system="truecolor" if color else None,
)
console.print(error)