Regression test for https://github.com/Textualize/rich/issues/3796 No NL should be written if there was nothing rendered.
()
| 170 | |
| 171 | |
| 172 | def 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" |
nothing calls this directly
no test coverage detected