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

Function test_broken_repr

tests/test_pretty.py:288–296  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

286
287
288def test_broken_repr() -> None:
289 class BrokenRepr:
290 def __repr__(self):
291 1 / 0
292
293 test = [BrokenRepr()]
294 result = pretty_repr(test)
295 expected = "[<repr-error 'division by zero'>]"
296 assert result == expected
297
298
299def test_broken_getattr() -> None:

Callers

nothing calls this directly

Calls 2

pretty_reprFunction · 0.90
BrokenReprClass · 0.70

Tested by

no test coverage detected