MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_webagg_fallback

Function test_webagg_fallback

lib/matplotlib/tests/test_backend_webagg.py:15–32  ·  view source on GitHub ↗
(backend)

Source from the content-addressed store, hash-verified

13
14@pytest.mark.parametrize("backend", ["webagg", "nbagg"])
15def test_webagg_fallback(backend):
16 pytest.importorskip("tornado")
17 if backend == "nbagg":
18 pytest.importorskip("IPython")
19 env = dict(os.environ)
20 if sys.platform != "win32":
21 env["DISPLAY"] = ""
22
23 env["MPLBACKEND"] = backend
24
25 test_code = (
26 "import os;"
27 + f"assert os.environ['MPLBACKEND'] == '{backend}';"
28 + "import matplotlib.pyplot as plt; "
29 + "print(plt.get_backend());"
30 f"assert '{backend}' == plt.get_backend().lower();"
31 )
32 subprocess_run_for_testing([sys.executable, "-c", test_code], env=env, check=True)
33
34
35def test_webagg_core_no_toolbar():

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…