Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve presentation of diagnostic errors using rich #10703

Merged
merged 10 commits into from
Dec 14, 2021
Prev Previous commit
Next Next commit
Properly handle newlines in diagnostic error tests
This is necessary to ensure that the output can be compared directly.
  • Loading branch information
pradyunsg committed Dec 12, 2021
commit e857d0f532a5745d9c76b927559915926b20a7cc
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