Show More
@@ -100,7 +100,7 b' class PylabMagics(Magics):' | |||
|
100 | 100 | % _list_matplotlib_backends_and_gui_loops() |
|
101 | 101 | ) |
|
102 | 102 | else: |
|
103 |
gui, backend = self.shell.enable_matplotlib(args.gui |
|
|
103 | gui, backend = self.shell.enable_matplotlib(args.gui) | |
|
104 | 104 | self._show_matplotlib_backend(args.gui, backend) |
|
105 | 105 | |
|
106 | 106 | @skip_doctest |
@@ -258,6 +258,29 b' class TestPylabSwitch(object):' | |||
|
258 | 258 | assert gui == "qt" |
|
259 | 259 | assert s.pylab_gui_select == "qt" |
|
260 | 260 | |
|
261 | @dec.skipif(not pt._matplotlib_manages_backends()) | |
|
262 | def test_backend_module_name_case_sensitive(self): | |
|
263 | # Matplotlib backend names are case insensitive unless explicitly specified using | |
|
264 | # "module://some_module.some_name" syntax which are case sensitive for mpl >= 3.9.1 | |
|
265 | all_lowercase = "module://matplotlib_inline.backend_inline" | |
|
266 | some_uppercase = "module://matplotlib_inline.Backend_inline" | |
|
267 | mpl3_9_1 = matplotlib.__version_info__ >= (3, 9, 1) | |
|
268 | ||
|
269 | s = self.Shell() | |
|
270 | s.enable_matplotlib(all_lowercase) | |
|
271 | if mpl3_9_1: | |
|
272 | with pytest.raises(RuntimeError): | |
|
273 | s.enable_matplotlib(some_uppercase) | |
|
274 | else: | |
|
275 | s.enable_matplotlib(some_uppercase) | |
|
276 | ||
|
277 | s.run_line_magic("matplotlib", all_lowercase) | |
|
278 | if mpl3_9_1: | |
|
279 | with pytest.raises(RuntimeError): | |
|
280 | s.run_line_magic("matplotlib", some_uppercase) | |
|
281 | else: | |
|
282 | s.run_line_magic("matplotlib", some_uppercase) | |
|
283 | ||
|
261 | 284 | |
|
262 | 285 | def test_no_gui_backends(): |
|
263 | 286 | for k in ['agg', 'svg', 'pdf', 'ps']: |
General Comments 0
You need to be logged in to leave comments.
Login now