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

Method test_inline_twice

IPython/core/tests/test_pylabtools.py:217–235  ·  view source on GitHub ↗

Using '%matplotlib inline' twice should not reset formatters

(self)

Source from the content-addressed store, hash-verified

215 nt.assert_equal(s.pylab_gui_select, 'qt')
216
217 def test_inline_twice(self):
218 "Using '%matplotlib inline' twice should not reset formatters"
219
220 ip = self.Shell()
221 gui, backend = ip.enable_matplotlib('inline')
222 nt.assert_equal(gui, 'inline')
223
224 fmts = {'png'}
225 active_mimes = {_fmt_mime_map[fmt] for fmt in fmts}
226 pt.select_figure_formats(ip, fmts)
227
228 gui, backend = ip.enable_matplotlib('inline')
229 nt.assert_equal(gui, 'inline')
230
231 for mime, f in ip.display_formatter.formatters.items():
232 if mime in active_mimes:
233 nt.assert_in(Figure, f)
234 else:
235 nt.assert_not_in(Figure, f)
236
237 def test_qt_gtk(self):
238 s = self.Shell()

Callers

nothing calls this directly

Calls 1

enable_matplotlibMethod · 0.80

Tested by

no test coverage detected