Skip to content

Commit

Permalink
Properly handle newlines in diagnostic error tests
Browse files Browse the repository at this point in the history
This is necessary to ensure that the output can be compared directly.
  • Loading branch information
pradyunsg committed Dec 5, 2021
1 parent d64cca2 commit c31bfec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/unit/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c31bfec

Please sign in to comment.