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

Function test_columns_highlight_added_by_add_row

tests/test_table.py:366–382  ·  view source on GitHub ↗

Regression test for https://github.com/Textualize/rich/issues/3517

()

Source from the content-addressed store, hash-verified

364
365
366def test_columns_highlight_added_by_add_row() -> None:
367 """Regression test for https://github.com/Textualize/rich/issues/3517"""
368 table = Table(show_header=False, highlight=True)
369 table.add_row("1", repr("FOO"))
370
371 assert table.columns[0].highlight == table.highlight
372 assert table.columns[1].highlight == table.highlight
373
374 console = Console(record=True)
375 console.print(table)
376 output = console.export_text(styles=True)
377 print(repr(output))
378
379 expected = (
380 "┌───┬───────┐\n│ \x1b[1;36m1\x1b[0m │ \x1b[32m'FOO'\x1b[0m │\n└───┴───────┘\n"
381 )
382 assert output == expected
383
384
385def test_padding_width():

Callers

nothing calls this directly

Calls 6

add_rowMethod · 0.95
printMethod · 0.95
export_textMethod · 0.95
TableClass · 0.90
ConsoleClass · 0.90
printFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…