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

Function test_cast_deep

tests/test_protocol.py:53–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51
52
53def test_cast_deep():
54 class B:
55 def __rich__(self) -> Foo:
56 return Foo()
57
58 class A:
59 def __rich__(self) -> B:
60 return B()
61
62 console = Console(file=io.StringIO())
63 console.print(A())
64 assert console.file.getvalue() == "Foo\n"
65
66
67def test_cast_recursive():

Callers

nothing calls this directly

Calls 3

printMethod · 0.95
ConsoleClass · 0.90
AClass · 0.85

Tested by

no test coverage detected