MCPcopy Create free account
hub / github.com/ipython/ipython / test_error_method

Function test_error_method

IPython/core/tests/test_formatters.py:241–252  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

239
240
241def test_error_method():
242 f = HTMLFormatter()
243 class BadHTML(object):
244 def _repr_html_(self):
245 raise ValueError("Bad HTML")
246 bad = BadHTML()
247 with capture_output() as captured:
248 result = f(bad)
249 nt.assert_is(result, None)
250 nt.assert_in("Traceback", captured.stdout)
251 nt.assert_in("Bad HTML", captured.stdout)
252 nt.assert_in("_repr_html_", captured.stdout)
253
254def test_nowarn_notimplemented():
255 f = HTMLFormatter()

Callers

nothing calls this directly

Calls 4

HTMLFormatterClass · 0.90
BadHTMLClass · 0.85
capture_outputClass · 0.85
fFunction · 0.70

Tested by

no test coverage detected