MCPcopy
hub / github.com/Textualize/rich / test_live_empty

Function test_live_empty

tests/test_live.py:172–187  ·  view source on GitHub ↗

Regression test for https://github.com/Textualize/rich/issues/3796 No NL should be written if there was nothing rendered.

()

Source from the content-addressed store, hash-verified

170
171
172def test_live_empty() -> None:
173 """Regression test for https://github.com/Textualize/rich/issues/3796
174
175 No NL should be written if there was nothing rendered.
176 """
177
178 from rich.console import Group
179
180 console = create_capture_console(width=20, height=5)
181 console.begin_capture()
182 with Live(Group(), console=console, transient=True):
183 pass
184 result = console.end_capture()
185 print(repr(result))
186 assert "\n" not in result
187 assert result == "\x1b[?25l\r\x1b[2K\x1b[?25h\r"

Callers

nothing calls this directly

Calls 6

LiveClass · 0.90
GroupClass · 0.90
create_capture_consoleFunction · 0.85
begin_captureMethod · 0.80
end_captureMethod · 0.80
printFunction · 0.50

Tested by

no test coverage detected