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

Function test_print_method_bound

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

Source from the content-addressed store, hash-verified

310 nt.assert_equal(f(pdf), 'PDF')
311
312def test_print_method_bound():
313 f = HTMLFormatter()
314 class MyHTML(object):
315 def _repr_html_(self):
316 return "hello"
317 with capture_output() as captured:
318 result = f(MyHTML)
319 nt.assert_is(result, None)
320 nt.assert_not_in("FormatterWarning", captured.stderr)
321
322 with capture_output() as captured:
323 result = f(MyHTML())
324 nt.assert_equal(result, "hello")
325 nt.assert_equal(captured.stderr, "")
326
327def test_print_method_weird():
328

Callers

nothing calls this directly

Calls 4

HTMLFormatterClass · 0.90
capture_outputClass · 0.85
MyHTMLClass · 0.85
fFunction · 0.70

Tested by

no test coverage detected