File tree 1 file changed +11
-5
lines changed
Filter options
1 file changed +11
-5
lines changed
Original file line number Diff line number Diff line change @@ -28,13 +28,19 @@ def _isolated_tk_test(success_count, func=None):
28
28
if "MPL_TEST_ESCAPE_HATCH" in os .environ :
29
29
return func
30
30
31
+ @pytest .mark .skipif (
32
+ importlib .util .find_spec ('tkinter' ),
33
+ reason = "missing tkinter"
34
+ )
35
+ @pytest .mark .skipif (
36
+ sys .platform == "linux" and not _c_internal_utils .display_is_valid (),
37
+ reason = "$DISPLAY and $WAYLAND_DISPLAY are unset"
38
+ )
31
39
@functools .wraps (func )
32
40
def test_func ():
33
- if (sys .platform == "linux" and
34
- not _c_internal_utils .display_is_valid ()):
35
- pytest .skip ("$DISPLAY and $WAYLAND_DISPLAY are unset" )
36
- elif not importlib .util .find_spec ('tkinter' ):
37
- pytest .skip ("missing tkinter" )
41
+ # even if the package exists, may not actually be importable this can
42
+ # be the case on some CI systems.
43
+ pytest .importorskip ('tkinter' )
38
44
try :
39
45
proc = subprocess_run_helper (
40
46
func , timeout = _test_timeout ,
You can’t perform that action at this time.
0 commit comments