File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919# an undesirable input hook).
2020
2121
22- def _get_available_backends ():
22+ def _get_testable_interactive_backends ():
2323 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 )
2830 for module_name , backend in [
2931 ("PyQt5" , "qt5agg" ),
3032 ("tkinter" , "tkagg" ),
@@ -41,9 +43,7 @@ def _get_available_backends():
4143"""
4244
4345
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 ())
4747def test_backend (backend ):
4848 environ = os .environ .copy ()
4949 environ ["MPLBACKEND" ] = backend
You can’t perform that action at this time.
0 commit comments