Regression test for https://github.com/Textualize/rich/issues/3871 Padding should be even between cells/
()
| 383 | |
| 384 | |
| 385 | def test_padding_width(): |
| 386 | class="st">"""Regression test for https://github.com/Textualize/rich/issues/3871 |
| 387 | |
| 388 | Padding should be even between cells/ |
| 389 | |
| 390 | class="st">""" |
| 391 | |
| 392 | table = Table.grid(padding=(0, 1)) |
| 393 | |
| 394 | for _ in range(3): |
| 395 | table.add_column(width=3) |
| 396 | |
| 397 | for row in range(1): |
| 398 | table.add_row(*[class="st">"a" * 3 for _ in range(3)]) |
| 399 | |
| 400 | console = Console(record=True) |
| 401 | console.print(table) |
| 402 | output = console.export_text(styles=True) |
| 403 | |
| 404 | print(repr(output)) |
| 405 | expected = class="st">"aaa aaa aaa\n" |
| 406 | assert output == expected |
| 407 | |
| 408 | |
| 409 | if __name__ == class="st">"__main__": |
nothing calls this directly
no test coverage detected