Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 524f867

Browse filesBrowse files
committed
Fix skipif in interactive backends test.
1 parent 9b9c24c commit 524f867
Copy full SHA for 524f867

File tree

Expand file treeCollapse file tree

1 file changed

+8
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-8
lines changed

‎lib/matplotlib/tests/test_backends_interactive.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_backends_interactive.py
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
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())
4747
def test_backend(backend):
4848
environ = os.environ.copy()
4949
environ["MPLBACKEND"] = backend

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.