mirror of https://github.com/Textualize/rich.git
test fix
This commit is contained in:
parent
3936debf0c
commit
fd7b32603c
|
@ -1005,7 +1005,8 @@ class Console:
|
|||
width: Optional[int] = None
|
||||
height: Optional[int] = None
|
||||
|
||||
for file_descriptor in _STD_STREAMS_OUTPUT if WINDOWS else _STD_STREAMS:
|
||||
streams = _STD_STREAMS_OUTPUT if WINDOWS else _STD_STREAMS
|
||||
for file_descriptor in streams:
|
||||
try:
|
||||
width, height = os.get_terminal_size(file_descriptor)
|
||||
except (AttributeError, ValueError, OSError): # Probably not a terminal
|
||||
|
|
|
@ -111,6 +111,7 @@ def test_title_text() -> None:
|
|||
console = Console(
|
||||
file=io.StringIO(),
|
||||
width=50,
|
||||
height=20,
|
||||
legacy_windows=False,
|
||||
force_terminal=True,
|
||||
color_system="truecolor",
|
||||
|
@ -119,7 +120,7 @@ def test_title_text() -> None:
|
|||
|
||||
result = console.file.getvalue()
|
||||
print(repr(result))
|
||||
expected = "╭───────────────────────────────────\x1b[31m title \x1b[0m────────────────────────────────────╮\n│ Hello, World │\n╰──────────────────────────────────\x1b[1;35m subtitle \x1b[0m──────────────────────────────────╯\n"
|
||||
expected = "╭────────────────────\x1b[31m title \x1b[0m─────────────────────╮\n│ Hello, World │\n╰───────────────────\x1b[1;35m subtitle \x1b[0m───────────────────╯\n"
|
||||
assert result == expected
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue