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

Function test_syntax_error

tests/test_traceback.py:127–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125
126
127def test_syntax_error():
128 console = Console(width=100, file=io.StringIO())
129 try:
130 # raises SyntaxError: unexpected EOF while parsing
131 eval("(2+2")
132 except SyntaxError:
133 console.print_exception()
134 exception_text = console.file.getvalue()
135 assert "SyntaxError" in exception_text
136
137
138def test_nested_exception():

Callers

nothing calls this directly

Calls 2

print_exceptionMethod · 0.95
ConsoleClass · 0.90

Tested by

no test coverage detected