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

Function test_recursive

tests/test_traceback.py:268–283  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

266
267
268def test_recursive():
269 def foo(n):
270 return bar(n)
271
272 def bar(n):
273 return foo(n)
274
275 console = Console(width=100, file=io.StringIO())
276 try:
277 foo(1)
278 except Exception:
279 console.print_exception(max_frames=6)
280 result = console.file.getvalue()
281 print(result)
282 assert "frames hidden" in result
283 assert result.count("in foo") < 4
284
285
286def test_suppress():

Callers

nothing calls this directly

Calls 4

print_exceptionMethod · 0.95
ConsoleClass · 0.90
fooFunction · 0.70
printFunction · 0.50

Tested by

no test coverage detected