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

Function test_print_method_bound

tests/test_formatters.py:379–394  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

377
378
379def test_print_method_bound():
380 f = HTMLFormatter()
381
382 class MyHTML(object):
383 def _repr_html_(self):
384 return "hello"
385
386 with capture_output() as captured:
387 result = f(MyHTML)
388 assert result is None
389 assert "FormatterWarning" not in captured.stderr
390
391 with capture_output() as captured:
392 result = f(MyHTML())
393 assert result == "hello"
394 assert captured.stderr == ""
395
396
397def test_print_method_weird():

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…