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

Function test_inline_twice

tests/test_pylabtools.py:248–266  ·  view source on GitHub ↗

Using '%matplotlib inline' twice should not reset formatters

(shell_pylab_fixture)

Source from the content-addressed store, hash-verified

246
247
248def test_inline_twice(shell_pylab_fixture):
249 "Using '%matplotlib inline' twice should not reset formatters"
250
251 ip = shell_pylab_fixture
252 gui, backend = ip.enable_matplotlib("inline")
253 assert gui is None
254
255 fmts = {"png"}
256 active_mimes = {_fmt_mime_map[fmt] for fmt in fmts}
257 pt.select_figure_formats(ip, fmts)
258
259 gui, backend = ip.enable_matplotlib("inline")
260 assert gui is None
261
262 for mime, f in ip.display_formatter.formatters.items():
263 if mime in active_mimes:
264 assert Figure in f
265 else:
266 assert Figure not in f
267
268
269def test_qt_gtk(shell_pylab_fixture):

Callers

nothing calls this directly

Calls 1

enable_matplotlibMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…