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

Function test_ipy_display_hook__repr_html

tests/test_pretty.py:65–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63
64
65def test_ipy_display_hook__repr_html() -> None:
66 console = Console(file=io.StringIO(), force_jupyter=True)
67
68 class Thing:
69 def _repr_html_(self):
70 return "hello"
71
72 console.begin_capture()
73 _ipy_display_hook(Thing(), console=console)
74
75 # Rendering delegated to notebook because _repr_html_ method exists
76 assert console.end_capture() == ""
77
78
79def test_ipy_display_hook__multiple_special_reprs() -> None:

Callers

nothing calls this directly

Calls 5

begin_captureMethod · 0.95
end_captureMethod · 0.95
ConsoleClass · 0.90
_ipy_display_hookFunction · 0.90
ThingClass · 0.70

Tested by

no test coverage detected