mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-06 07:55:10 +00:00
test(console): build the width test console outside Rich legacy Windows mode
This commit is contained in:
@@ -6,6 +6,8 @@ from pathlib import Path
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
SCRIPT = """
|
SCRIPT = """
|
||||||
|
import rich.console
|
||||||
|
rich.console.detect_legacy_windows = lambda: False
|
||||||
from unshackle.core.config import config
|
from unshackle.core.config import config
|
||||||
config.wide_output = {wide}
|
config.wide_output = {wide}
|
||||||
from rich.padding import Padding
|
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.
|
"""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.
|
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(
|
out = subprocess.run(
|
||||||
[sys.executable, "-c", SCRIPT.format(wide=wide)],
|
[sys.executable, "-c", SCRIPT.format(wide=wide)],
|
||||||
|
|||||||
Reference in New Issue
Block a user