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

Function test_section

tests/test_table.py:212–235  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

210
211
212def test_section():
213 table = Table("foo")
214 table.add_section() # Null-op
215 table.add_row("row1")
216 table.add_row("row2", end_section=True)
217 table.add_row("row3")
218 table.add_row("row4")
219 table.add_section()
220 table.add_row("row5")
221 table.add_section() # Null-op
222
223 console = Console(
224 width=80,
225 force_terminal=True,
226 color_system="truecolor",
227 legacy_windows=False,
228 record=True,
229 )
230 console.print(table)
231 output = console.export_text()
232 print(repr(output))
233 expected = "┏━━━━━━┓\n┃ foo ┃\n┡━━━━━━┩\n│ row1 │\n│ row2 │\n├──────┤\n│ row3 │\n│ row4 │\n├──────┤\n│ row5 │\n└──────┘\n"
234
235 assert output == expected
236
237
238@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 7

add_sectionMethod · 0.95
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…