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

Function test_set_matplotlib_formats_kwargs

tests/test_display_2.py:195–214  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

193
194@dec.skip_without("matplotlib")
195def test_set_matplotlib_formats_kwargs():
196 from matplotlib.figure import Figure
197 from matplotlib_inline.backend_inline import set_matplotlib_formats
198
199 ip = get_ipython()
200 cfg = _get_inline_config()
201 cfg.print_figure_kwargs.update(dict(foo="bar"))
202 kwargs = dict(dpi=150)
203 try:
204 set_matplotlib_formats("png", **kwargs)
205 formatter = ip.display_formatter.formatters["image/png"]
206 f = formatter.lookup_by_type(Figure)
207 formatter_kwargs = f.keywords
208 expected = kwargs
209 expected["base64"] = True
210 expected["fmt"] = "png"
211 expected.update(cfg.print_figure_kwargs)
212 assert formatter_kwargs == expected
213 finally:
214 cfg.print_figure_kwargs.clear()
215
216
217@dec.skip_without("matplotlib")

Callers

nothing calls this directly

Calls 4

get_ipythonFunction · 0.90
_get_inline_configFunction · 0.85
lookup_by_typeMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…