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

Function test_render

tests/test_inspect.py:98–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96
97
98def test_render():
99 console = Console(width=100, file=io.StringIO(), legacy_windows=False)
100
101 foo = Foo("hello")
102 inspect(foo, console=console, all=True, value=False)
103 result = console.file.getvalue()
104 print(repr(result))
105 expected = "╭────────────── <class 'tests.test_inspect.Foo'> ──────────────╮\n│ Foo test │\n│ │\n│ broken = InspectError() │\n│ __init__ = def __init__(foo: int) -> None: constructor docs. │\n│ method = def method(a, b) -> str: Multi line │\n╰──────────────────────────────────────────────────────────────╯\n"
106 assert result == expected
107
108
109@skip_pypy3

Callers

nothing calls this directly

Calls 4

ConsoleClass · 0.90
inspectFunction · 0.90
FooClass · 0.70
printFunction · 0.50

Tested by

no test coverage detected