##// END OF EJS Templates
Add test that display is available without imports.
Matthias Bussonnier -
Show More
@@ -13,6 +13,7 b' from IPython.core import display'
13 from IPython.core.getipython import get_ipython
13 from IPython.core.getipython import get_ipython
14 from IPython.utils.tempdir import NamedFileInTemporaryDirectory
14 from IPython.utils.tempdir import NamedFileInTemporaryDirectory
15 from IPython import paths as ipath
15 from IPython import paths as ipath
16 from IPython.testing.tools import AssertPrints, AssertNotPrints
16
17
17 import IPython.testing.decorators as dec
18 import IPython.testing.decorators as dec
18
19
@@ -141,6 +142,25 b' def test_set_matplotlib_formats_kwargs():'
141 expected.update(cfg.print_figure_kwargs)
142 expected.update(cfg.print_figure_kwargs)
142 nt.assert_equal(cell, expected)
143 nt.assert_equal(cell, expected)
143
144
145 def test_display_available():
146 """
147 Test that display is available without import
148
149 We don't really care if it's in builtin or anything else, but it should
150 always be available.
151 """
152 ip = get_ipython()
153 with AssertNotPrints('NameError'):
154 ip.run_cell('display')
155 try:
156 ip.run_cell('del display')
157 except NameError:
158 pass # it's ok, it might be in builtins
159 # even if deleted it should be back
160 with AssertNotPrints('NameError'):
161 ip.run_cell('display')
162
163
144 def test_displayobject_repr():
164 def test_displayobject_repr():
145 h = display.HTML('<br />')
165 h = display.HTML('<br />')
146 nt.assert_equal(repr(h), '<IPython.core.display.HTML object>')
166 nt.assert_equal(repr(h), '<IPython.core.display.HTML object>')
General Comments 0
You need to be logged in to leave comments. Login now