()
| 157 | |
| 158 | @dec.skip_without('matplotlib') |
| 159 | def test_set_matplotlib_formats(): |
| 160 | from matplotlib.figure import Figure |
| 161 | formatters = get_ipython().display_formatter.formatters |
| 162 | for formats in [ |
| 163 | ('png',), |
| 164 | ('pdf', 'svg'), |
| 165 | ('jpeg', 'retina', 'png'), |
| 166 | (), |
| 167 | ]: |
| 168 | active_mimes = {_fmt_mime_map[fmt] for fmt in formats} |
| 169 | display.set_matplotlib_formats(*formats) |
| 170 | for mime, f in formatters.items(): |
| 171 | if mime in active_mimes: |
| 172 | nt.assert_in(Figure, f) |
| 173 | else: |
| 174 | nt.assert_not_in(Figure, f) |
| 175 | |
| 176 | @dec.skip_without('matplotlib') |
| 177 | def test_set_matplotlib_formats_kwargs(): |
nothing calls this directly
no test coverage detected