Skip to content

Commit 491e2a7

Browse files
authored
Merge pull request #19301 from QuLogic/fix-azure
Fix several CI issues
2 parents 75d1fbc + ed3760f commit 491e2a7

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

.appveyor.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ environment:
1818
PYTHONIOENCODING: UTF-8
1919
PYTEST_ARGS: -raR --numprocesses=auto --timeout=300 --durations=25
2020
--cov-report= --cov=lib --log-level=DEBUG
21+
PINNEDVERS: "pyzmq!=21.0.0"
2122

2223
matrix:
2324
# In theory we could use a single CONDA_INSTALL_LOCN because we construct

azure-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ steps:
7272
texlive-xetex texlive-luatex
7373
;;
7474
darwin)
75-
brew cask install xquartz
75+
brew install --cask xquartz
7676
brew install pkg-config ffmpeg imagemagick mplayer ccache
7777
;;
7878
win32)

lib/matplotlib/tests/test_backends_interactive.py

+18-17
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,14 @@ def _get_testable_interactive_backends():
5050
reason = "macosx backend fails on Azure"
5151
elif 'qt5' in backend and not have_qt5:
5252
reason = "no usable Qt5 bindings"
53+
marks = []
5354
if reason:
54-
backend = pytest.param(
55-
backend,
56-
marks=pytest.mark.skip(
57-
reason=f"Skipping {backend} because {reason}"))
55+
marks.append(pytest.mark.skip(
56+
reason=f"Skipping {backend} because {reason}"))
5857
elif backend.startswith('wx') and sys.platform == 'darwin':
5958
# ignore on OSX because that's currently broken (github #16849)
60-
backend = pytest.param(
61-
backend,
62-
marks=pytest.mark.xfail(reason='github #16849'))
59+
marks.append(pytest.mark.xfail(reason='github #16849'))
60+
backend = pytest.param(backend, marks=marks)
6361
backends.append(backend)
6462
return backends
6563

@@ -216,16 +214,19 @@ def _test_thread_impl():
216214

217215
_thread_safe_backends = _get_testable_interactive_backends()
218216
# Known unsafe backends. Remove the xfails if they start to pass!
219-
if "wx" in _thread_safe_backends:
220-
_thread_safe_backends.remove("wx")
221-
_thread_safe_backends.append(
222-
pytest.param("wx", marks=pytest.mark.xfail(
223-
raises=subprocess.CalledProcessError)))
224-
if "macosx" in _thread_safe_backends:
225-
_thread_safe_backends.remove("macosx")
226-
_thread_safe_backends.append(
227-
pytest.param("macosx", marks=pytest.mark.xfail(
228-
raises=subprocess.TimeoutExpired, strict=True)))
217+
for param in _thread_safe_backends:
218+
backend = param.values[0]
219+
if "cairo" in backend:
220+
# Cairo backends save a cairo_t on the graphics context, and sharing
221+
# these is not threadsafe.
222+
param.marks.append(
223+
pytest.mark.xfail(raises=subprocess.CalledProcessError))
224+
elif backend == "wx":
225+
param.marks.append(
226+
pytest.mark.xfail(raises=subprocess.CalledProcessError))
227+
elif backend == "macosx":
228+
param.marks.append(
229+
pytest.mark.xfail(raises=subprocess.TimeoutExpired, strict=True))
229230

230231

231232
@pytest.mark.parametrize("backend", _thread_safe_backends)

0 commit comments

Comments
 (0)