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

Function test_print_exception

tests/test_traceback.py:93–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91
92
93def test_print_exception():
94 console = Console(width=100, file=io.StringIO())
95 try:
96 1 / 0
97 except Exception:
98 console.print_exception()
99 exception_text = console.file.getvalue()
100 assert "ZeroDivisionError" in exception_text
101
102
103def test_print_exception_no_msg():

Callers

nothing calls this directly

Calls 2

print_exceptionMethod · 0.95
ConsoleClass · 0.90

Tested by

no test coverage detected