Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

Commit 304befc

Browse files
committed
Try Anthony's new patch
1 parent 88808aa commit 304befc

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

patches/test_backends.patch

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
--- tests/test_backends_interactive.py.old 2017-05-30 09:29:32.000000000 +0100
2-
+++ tests/test_backends_interactive.py 2017-05-30 09:54:41.000000000 +0100
3-
@@ -41,11 +41,12 @@
2+
+++ tests/test_backends_interactive.py 2017-05-31 12:07:50.000000000 +0100
3+
@@ -21,10 +21,12 @@
4+
5+
def _get_available_backends():
6+
return [
7+
- pytest.mark.skipif(sys.version_info < (3,)
8+
- or importlib.util.find_spec(module_name) is None,
9+
- reason="Could not import {!r}".format(module_name))(
10+
- backend)
11+
+ pytest.mark.skipif(
12+
+ not os.environ.get("DISPLAY")
13+
+ or sys.version_info < (3,)
14+
+ or importlib.util.find_spec(module_name) is None,
15+
+ reason="No /tmp/launch-jw0bwI/org.macosforge.xquartz:0, or could not import {!r}".format(module_name))(
16+
+ backend)
17+
for module_name, backend in [
18+
("PyQt5", "qt5agg"),
19+
("tkinter", "tkagg"),
20+
@@ -41,8 +43,6 @@
421
"""
522

623

7-
+@pytest.mark.parametrize("backend", _get_available_backends())
8-
@pytest.mark.skipif("DISPLAY" not in os.environ,
9-
reason="The DISPLAY environment variable is not set.")
10-
-@pytest.mark.parametrize("backend", _get_available_backends())
24+
-@pytest.mark.skipif("DISPLAY" not in os.environ,
25+
- reason="The DISPLAY environment variable is not set.")
26+
@pytest.mark.parametrize("backend", _get_available_backends())
1127
def test_backend(backend):
1228
environ = os.environ.copy()
13-
+ assert environ.get('DISPLAY') is None
14-
environ["MPLBACKEND"] = backend
15-
proc = Popen([sys.executable, "-c", _test_script], env=environ)
16-
# Empirically, 1s is not enough on Travis.

0 commit comments

Comments
 (0)