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

Function test_padding_width

tests/test_table.py:385–406  ·  tests/test_table.py::test_padding_width

Regression test for https://github.com/Textualize/rich/issues/3871 Padding should be even between cells/

()

Source from the content-addressed store, hash-verified

383
384
385def 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
409if __name__ == class="st">"__main__":

Callers

nothing calls this directly

Calls 7

printMethod · 0.95
export_textMethod · 0.95
ConsoleClass · 0.90
gridMethod · 0.80
add_columnMethod · 0.80
add_rowMethod · 0.80
printFunction · 0.50

Tested by

no test coverage detected