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

Function test_print_exception_locals

tests/test_traceback.py:114–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112
113
114def test_print_exception_locals():
115 console = Console(width=100, file=io.StringIO())
116 try:
117 1 / 0
118 except Exception:
119 console.print_exception(show_locals=True)
120 exception_text = console.file.getvalue()
121 print(exception_text)
122 assert "ZeroDivisionError" in exception_text
123 assert "locals" in exception_text
124 assert "console = <console width=100 None>" in exception_text
125
126
127def test_syntax_error():

Callers

nothing calls this directly

Calls 3

print_exceptionMethod · 0.95
ConsoleClass · 0.90
printFunction · 0.50

Tested by

no test coverage detected