disable legacy windows

This commit is contained in:
Will McGugan 2021-11-09 17:43:23 +00:00
parent 84faaa898a
commit f60dcd168a
2 changed files with 6 additions and 6 deletions

View File

@ -100,7 +100,7 @@ def test_size():
w, h = console.size
assert console.width == w
console = Console(width=99, height=101)
console = Console(width=99, height=101, legacy_windows=False)
w, h = console.size
assert w == 99 and h == 101
@ -607,13 +607,13 @@ def test_height():
def test_columns_env():
console = Console(_environ={"COLUMNS": "314"})
console = Console(_environ={"COLUMNS": "314"}, legacy_windows=False)
assert console.width == 314
# width take precedence
console = Console(width=40, _environ={"COLUMNS": "314"})
console = Console(width=40, _environ={"COLUMNS": "314"}, legacy_windows=False)
assert console.width == 40
# Should not fail
console = Console(width=40, _environ={"COLUMNS": "broken"})
console = Console(width=40, _environ={"COLUMNS": "broken"}, legacy_windows=False)
def test_lines_env():
@ -689,7 +689,7 @@ def test_print_width_zero():
def test_size_properties():
console = Console(width=80, height=25)
console = Console(width=80, height=25, legacy_windows=False)
assert console.size == ConsoleDimensions(80, 25)
console.size = (10, 20)
assert console.size == ConsoleDimensions(10, 20)

View File

@ -3,7 +3,7 @@ from rich.screen import Screen
def test_screen():
console = Console(color_system=None, width=20, height=5)
console = Console(color_system=None, width=20, height=5, legacy_windows=False)
with console.capture() as capture:
console.print(Screen("foo\nbar\nbaz\nfoo\nbar\nbaz\foo"))
result = capture.get()