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

Function test_backend_module_name_case_sensitive

tests/test_pylabtools.py:281–301  ·  view source on GitHub ↗
(shell_pylab_fixture)

Source from the content-addressed store, hash-verified

279
280@dec.skipif(not pt._matplotlib_manages_backends())
281def test_backend_module_name_case_sensitive(shell_pylab_fixture):
282 # Matplotlib backend names are case insensitive unless explicitly specified using
283 # "module://some_module.some_name" syntax which are case sensitive for mpl >= 3.9.1
284 all_lowercase = "module://matplotlib_inline.backend_inline"
285 some_uppercase = "module://matplotlib_inline.Backend_inline"
286 mpl3_9_1 = matplotlib.__version_info__ >= (3, 9, 1)
287
288 s = shell_pylab_fixture
289 s.enable_matplotlib(all_lowercase)
290 if mpl3_9_1:
291 with pytest.raises(RuntimeError):
292 s.enable_matplotlib(some_uppercase)
293 else:
294 s.enable_matplotlib(some_uppercase)
295
296 s.run_line_magic("matplotlib", all_lowercase)
297 if mpl3_9_1:
298 with pytest.raises(RuntimeError):
299 s.run_line_magic("matplotlib", some_uppercase)
300 else:
301 s.run_line_magic("matplotlib", some_uppercase)
302
303
304def test_no_gui_backends():

Callers

nothing calls this directly

Calls 2

enable_matplotlibMethod · 0.80
run_line_magicMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…