I am done

This commit is contained in:
2024-10-30 22:14:35 +01:00
parent 720dc28c09
commit 40e2a747cf
36901 changed files with 5011519 additions and 0 deletions

View File

@ -0,0 +1,32 @@
import os
import sys
import pytest
import matplotlib.backends.backend_webagg_core
from matplotlib.testing import subprocess_run_for_testing
@pytest.mark.parametrize("backend", ["webagg", "nbagg"])
def test_webagg_fallback(backend):
pytest.importorskip("tornado")
if backend == "nbagg":
pytest.importorskip("IPython")
env = dict(os.environ)
if sys.platform != "win32":
env["DISPLAY"] = ""
env["MPLBACKEND"] = backend
test_code = (
"import os;"
+ f"assert os.environ['MPLBACKEND'] == '{backend}';"
+ "import matplotlib.pyplot as plt; "
+ "print(plt.get_backend());"
f"assert '{backend}' == plt.get_backend().lower();"
)
subprocess_run_for_testing([sys.executable, "-c", test_code], env=env, check=True)
def test_webagg_core_no_toolbar():
fm = matplotlib.backends.backend_webagg_core.FigureManagerWebAgg
assert fm._toolbar2_class is None