diff --git a/tests/core/test_console_width.py b/tests/core/test_console_width.py index 2dcb5156..019773b6 100644 --- a/tests/core/test_console_width.py +++ b/tests/core/test_console_width.py @@ -6,6 +6,8 @@ from pathlib import Path import pytest SCRIPT = """ +import rich.console +rich.console.detect_legacy_windows = lambda: False from unshackle.core.config import config config.wide_output = {wide} from rich.padding import Padding @@ -31,6 +33,7 @@ def test_console_follows_wide_output(wide: bool, width: int) -> None: """With wide_output the console takes the terminal width and track bars fill the line to one right edge. Without it the console holds 80 columns and each bar 40 cells. Both are read at import, hence the subprocess. + The child turns off Rich legacy Windows mode, which on a Windows pipe drops one column and draws ASCII bars. """ out = subprocess.run( [sys.executable, "-c", SCRIPT.format(wide=wide)],