Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54d718e commit bb489d7Copy full SHA for bb489d7
1 file changed
lib/matplotlib/tests/test_rcparams.py
@@ -5,6 +5,7 @@
5
from unittest import mock
6
7
from cycler import cycler, Cycler
8
+from packaging.version import parse as parse_version
9
import pytest
10
11
import matplotlib as mpl
@@ -539,7 +540,12 @@ def test_backend_fallback_headless(tmp_path):
539
540
sys.platform == "linux" and not _c_internal_utils.xdisplay_is_valid(),
541
reason="headless")
542
def test_backend_fallback_headful(tmp_path):
- pytest.importorskip("tkinter")
543
+ if parse_version(pytest.__version__) >= parse_version('8.2.0'):
544
+ pytest_kwargs = dict(exc_type=ImportError)
545
+ else:
546
+ pytest_kwargs = {}
547
+
548
+ pytest.importorskip("tkinter", **pytest_kwargs)
549
env = {**os.environ, "MPLBACKEND": "", "MPLCONFIGDIR": str(tmp_path)}
550
backend = subprocess_run_for_testing(
551
[sys.executable, "-c",
0 commit comments