File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 19
19
# an undesirable input hook).
20
20
21
21
22
- def _get_available_backends ():
22
+ def _get_testable_interactive_backends ():
23
23
return [
24
- pytest .mark .skipif (sys .version_info < (3 ,)
25
- or importlib .util .find_spec (module_name ) is None ,
26
- reason = "Could not import {!r}" .format (module_name ))(
27
- backend )
24
+ pytest .mark .skipif (
25
+ not os .environ .get ("DISPLAY" )
26
+ or sys .version_info < (3 ,)
27
+ or importlib .util .find_spec (module_name ) is None ,
28
+ reason = "No $DISPLAY or could not import {!r}" .format (module_name ))(
29
+ backend )
28
30
for module_name , backend in [
29
31
("PyQt5" , "qt5agg" ),
30
32
("tkinter" , "tkagg" ),
@@ -41,9 +43,7 @@ def _get_available_backends():
41
43
"""
42
44
43
45
44
- @pytest .mark .skipif ("DISPLAY" not in os .environ ,
45
- reason = "The DISPLAY environment variable is not set." )
46
- @pytest .mark .parametrize ("backend" , _get_available_backends ())
46
+ @pytest .mark .parametrize ("backend" , _get_testable_interactive_backends ())
47
47
def test_backend (backend ):
48
48
environ = os .environ .copy ()
49
49
environ ["MPLBACKEND" ] = backend
You can’t perform that action at this time.
0 commit comments