Skip to content

Commit bc155f0

Browse files
committed
Also test PySide2 on CI.
1 parent e23b2aa commit bc155f0

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ install:
143143
python -c 'import PyQt5.QtCore' &&
144144
echo 'PyQt5 is available' ||
145145
echo 'PyQt5 is not available'
146+
python -mpip install --upgrade pyside2 &&
147+
python -c 'import PySide2.QtCore' &&
148+
echo 'PySide2 is available' ||
149+
echo 'PySide2 is not available'
146150
python -mpip install --upgrade \
147151
-f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-14.04 \
148152
wxPython &&

lib/matplotlib/tests/test_backends_interactive.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,23 @@ def _get_testable_interactive_backends():
2323
(["cairo", "gi"], "gtk3cairo"),
2424
(["PyQt5"], "qt5agg"),
2525
(["PyQt5", "cairocffi"], "qt5cairo"),
26+
(["PySide2"], "qt5agg"),
27+
(["PySide2", "cairocffi"], "qt5cairo"),
2628
(["tkinter"], "tkagg"),
2729
(["wx"], "wx"),
2830
(["wx"], "wxagg"),
2931
]:
3032
reason = None
33+
missing = [dep for dep in deps if not importlib.util.find_spec(dep)]
3134
if not os.environ.get("DISPLAY"):
32-
reason = "No $DISPLAY"
33-
elif any(importlib.util.find_spec(dep) is None for dep in deps):
34-
reason = "Missing dependency"
35+
reason = "$DISPLAY is unset"
36+
elif missing:
37+
reason = "{} cannot be imported".format(", ".join(missing))
3538
if reason:
3639
backend = pytest.param(
37-
backend, marks=pytest.mark.skip(reason=reason))
40+
backend,
41+
marks=pytest.mark.skip(
42+
reason=f"Skipping {backend} because {reason}"))
3843
backends.append(backend)
3944
return backends
4045

0 commit comments

Comments
 (0)