Skip to content

Commit 84c4d7e

Browse files
authored
Merge pull request matplotlib#29206 from QuLogic/wayland-tests
Skip more tests on pure-Wayland systems
2 parents 2465c0b + e83e847 commit 84c4d7e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/matplotlib/tests/test_backends_interactive.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ def _get_available_interactive_backends():
7878
missing = [dep for dep in deps if not importlib.util.find_spec(dep)]
7979
if missing:
8080
reason = "{} cannot be imported".format(", ".join(missing))
81-
elif env["MPLBACKEND"] == "tkagg" and _is_linux_and_xdisplay_invalid:
81+
elif _is_linux_and_xdisplay_invalid and (
82+
env["MPLBACKEND"] == "tkagg"
83+
# Remove when https://github.com/wxWidgets/Phoenix/pull/2638 is out.
84+
or env["MPLBACKEND"].startswith("wx")):
8285
reason = "$DISPLAY is unset"
8386
elif _is_linux_and_display_invalid:
8487
reason = "$DISPLAY and $WAYLAND_DISPLAY are unset"
@@ -452,6 +455,9 @@ def qt5_and_qt6_pairs():
452455
yield from ([qt5, qt6], [qt6, qt5])
453456

454457

458+
@pytest.mark.skipif(
459+
sys.platform == "linux" and not _c_internal_utils.display_is_valid(),
460+
reason="$DISPLAY and $WAYLAND_DISPLAY are unset")
455461
@pytest.mark.parametrize('host, mpl', [*qt5_and_qt6_pairs()])
456462
def test_cross_Qt_imports(host, mpl):
457463
try:

0 commit comments

Comments
 (0)