@@ -96,6 +96,32 @@ steps:
96
96
python -m pip install --upgrade pip
97
97
python -m pip install -r requirements/testing/travis_all.txt -r requirements/testing/travis_extra.txt ||
98
98
[[ "$PYTHON_VERSION" = 'Pre' ]]
99
+ if [[ "$PYTHON_VERSION" != 'Pre' ]]; then
100
+ # GUI toolkits are pip-installable only for some versions of Python so
101
+ # don't fail if we can't install them. Make it easier to check whether the
102
+ # install was successful by trying to import the toolkit (sometimes, the
103
+ # install appears to be successful but shared libraries cannot be loaded at
104
+ # runtime, so an actual import is a better check).
105
+ python -mpip install --upgrade pycairo cairocffi>=0.8
106
+ python -mpip install --upgrade PyGObject &&
107
+ python -c 'import gi; gi.require_version("Gtk", "3.0"); from gi.repository import Gtk' &&
108
+ echo 'PyGObject is available' ||
109
+ echo 'PyGObject is not available'
110
+ python -mpip install --upgrade pyqt5 &&
111
+ python -c 'import PyQt5.QtCore' &&
112
+ echo 'PyQt5 is available' ||
113
+ echo 'PyQt5 is not available'
114
+ python -mpip install --upgrade pyside2 &&
115
+ python -c 'import PySide2.QtCore' &&
116
+ echo 'PySide2 is available' ||
117
+ echo 'PySide2 is not available'
118
+ python -mpip install --upgrade \
119
+ -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 \
120
+ wxPython &&
121
+ python -c 'import wx' &&
122
+ echo 'wxPython is available' ||
123
+ echo 'wxPython is not available'
124
+ fi
99
125
displayName :' Install dependencies with pip'
100
126
101
127
-bash :|
@@ -107,6 +133,10 @@ steps:
107
133
displayName :' print env'
108
134
109
135
-bash :|
136
+ if [[ "$(python -c 'import sys; print(sys.platform)')" = linux ]]; then
137
+ Xvfb :99 &
138
+ export DISPLAY=:99
139
+ fi
110
140
PYTHONFAULTHANDLER=1 python -m pytest --junitxml=junit/test-results.xml -raR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n 2 ||
111
141
[[ "$PYTHON_VERSION" = 'Pre' ]]
112
142
displayName :' pytest'