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 e4c87e7

Browse filesBrowse files
committed
Try running GUI tests on all platforms on Azure.
... including the osx backend on osx.
1 parent 54b4263 commit e4c87e7
Copy full SHA for e4c87e7

File tree

Expand file treeCollapse file tree

2 files changed

+33
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+33
-2
lines changed

‎azure-pipelines.yml

Copy file name to clipboardExpand all lines: azure-pipelines.yml
+30Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,32 @@ steps:
9696
python -m pip install --upgrade pip
9797
python -m pip install -r requirements/testing/travis_all.txt -r requirements/testing/travis_extra.txt ||
9898
[[ "$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
99125
displayName: 'Install dependencies with pip'
100126

101127
- bash: |
@@ -107,6 +133,10 @@ steps:
107133
displayName: 'print env'
108134

109135
- bash: |
136+
if [[ "$(python -c 'import sys; print(sys.platform)')" = linux ]]; then
137+
Xvfb :99 &
138+
export DISPLAY=:99
139+
fi
110140
PYTHONFAULTHANDLER=1 python -m pytest --junitxml=junit/test-results.xml -raR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n 2 ||
111141
[[ "$PYTHON_VERSION" = 'Pre' ]]
112142
displayName: 'pytest'

‎lib/matplotlib/tests/test_backends_interactive.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_backends_interactive.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
# Minimal smoke-testing of the backends for which the dependencies are
16-
# PyPI-installable on Travis. They are not available for all tested Python
16+
# PyPI-installable on CI. They are not available for all tested Python
1717
# versions so we don't fail on missing backends.
1818

1919
def _get_testable_interactive_backends():
@@ -28,10 +28,11 @@ def _get_testable_interactive_backends():
2828
(["tkinter"], "tkagg"),
2929
(["wx"], "wx"),
3030
(["wx"], "wxagg"),
31+
(["matplotlib.backends.backend_macosx"], "macosx"),
3132
]:
3233
reason = None
3334
missing = [dep for dep in deps if not importlib.util.find_spec(dep)]
34-
if not os.environ.get("DISPLAY"):
35+
if sys.platform == "linux" and not os.environ.get("DISPLAY"):
3536
reason = "$DISPLAY is unset"
3637
elif missing:
3738
reason = "{} cannot be imported".format(", ".join(missing))

0 commit comments

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