(backend)
| 13 | |
| 14 | @pytest.mark.parametrize("backend", ["webagg", "nbagg"]) |
| 15 | def 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 | |
| 35 | def test_webagg_core_no_toolbar(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…