From 8f82b7d538dcb17e6bb5a5af386bdd64056a128e 2014-01-20 00:13:53 From: MinRK Date: 2014-01-20 00:13:53 Subject: [PATCH] test formatter raising NotImplementedError --- diff --git a/IPython/core/tests/test_formatters.py b/IPython/core/tests/test_formatters.py index a2972cc..e2ce0f4 100644 --- a/IPython/core/tests/test_formatters.py +++ b/IPython/core/tests/test_formatters.py @@ -244,6 +244,18 @@ def test_warn_error_method(): nt.assert_in("text/html", captured.stderr) nt.assert_in("zero", captured.stderr) +def test_nowarn_notimplemented(): + f = HTMLFormatter() + class HTMLNotImplemented(object): + def _repr_html_(self): + raise NotImplementedError + return 1/0 + h = HTMLNotImplemented() + with capture_output() as captured: + result = f(h) + nt.assert_is(result, None) + nt.assert_not_in("WARNING", captured.stderr) + def test_warn_error_for_type(): f = HTMLFormatter() f.for_type(int, lambda i: name_error)