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

Function test_pretty_namedtuple

tests/test_pretty.py:207–231  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

205
206
207def test_pretty_namedtuple() -> None:
208 console = Console(color_system=None)
209 console.begin_capture()
210
211 example_namedtuple = StockKeepingUnit(
212 "Sparkling British Spring Water",
213 "Carbonated spring water",
214 0.9,
215 "water",
216 ["its amazing!", "its terrible!"],
217 )
218
219 result = pretty_repr(example_namedtuple)
220
221 print(result)
222 assert (
223 result
224 == """StockKeepingUnit(
225 name='Sparkling British Spring Water',
226 description='Carbonated spring water',
227 price=0.9,
228 category='water',
229 reviews=['its amazing!', 'its terrible!']
230)"""
231 )
232
233
234def test_pretty_namedtuple_length_one_no_trailing_comma() -> None:

Callers

nothing calls this directly

Calls 5

begin_captureMethod · 0.95
ConsoleClass · 0.90
pretty_reprFunction · 0.90
StockKeepingUnitClass · 0.70
printFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…