MCPcopy Index your code
hub / github.com/ipython/ipython / test_error_pretty_method

Function test_error_pretty_method

tests/test_formatters.py:339–353  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

337
338
339def test_error_pretty_method():
340 f = PlainTextFormatter()
341
342 class BadPretty(object):
343 def _repr_pretty_(self):
344 return "hello"
345
346 bad = BadPretty()
347 with capture_output() as captured:
348 result = f(bad)
349 assert result is None
350 assert "Traceback" in captured.stdout
351 assert "_repr_pretty_" in captured.stdout
352 assert "given" in captured.stdout
353 assert "argument" in captured.stdout
354
355
356def test_bad_repr_traceback():

Callers

nothing calls this directly

Calls 4

PlainTextFormatterClass · 0.90
BadPrettyClass · 0.85
capture_outputClass · 0.85
fFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…