Skip to content

Fix several CI issues #19301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ environment:
PYTHONIOENCODING: UTF-8
PYTEST_ARGS: -raR --numprocesses=auto --timeout=300 --durations=25
--cov-report= --cov=lib --log-level=DEBUG
PINNEDVERS: "pyzmq!=21.0.0"

matrix:
# In theory we could use a single CONDA_INSTALL_LOCN because we construct
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ steps:
texlive-xetex texlive-luatex
;;
darwin)
brew cask install xquartz
brew install --cask xquartz
brew install pkg-config ffmpeg imagemagick mplayer ccache
;;
win32)
Expand Down
35 changes: 18 additions & 17 deletions lib/matplotlib/tests/test_backends_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,14 @@ def _get_testable_interactive_backends():
reason = "macosx backend fails on Azure"
elif 'qt5' in backend and not have_qt5:
reason = "no usable Qt5 bindings"
marks = []
if reason:
backend = pytest.param(
backend,
marks=pytest.mark.skip(
reason=f"Skipping {backend} because {reason}"))
marks.append(pytest.mark.skip(
reason=f"Skipping {backend} because {reason}"))
elif backend.startswith('wx') and sys.platform == 'darwin':
# ignore on OSX because that's currently broken (github #16849)
backend = pytest.param(
backend,
marks=pytest.mark.xfail(reason='github #16849'))
marks.append(pytest.mark.xfail(reason='github #16849'))
backend = pytest.param(backend, marks=marks)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change ensures we always have a pytest.param, so that the later loop is simpler.

backends.append(backend)
return backends

Expand Down Expand Up @@ -216,16 +214,19 @@ def _test_thread_impl():

_thread_safe_backends = _get_testable_interactive_backends()
# Known unsafe backends. Remove the xfails if they start to pass!
if "wx" in _thread_safe_backends:
_thread_safe_backends.remove("wx")
_thread_safe_backends.append(
pytest.param("wx", marks=pytest.mark.xfail(
raises=subprocess.CalledProcessError)))
if "macosx" in _thread_safe_backends:
_thread_safe_backends.remove("macosx")
_thread_safe_backends.append(
pytest.param("macosx", marks=pytest.mark.xfail(
raises=subprocess.TimeoutExpired, strict=True)))
for param in _thread_safe_backends:
backend = param.values[0]
if "cairo" in backend:
# Cairo backends save a cairo_t on the graphics context, and sharing
# these is not threadsafe.
param.marks.append(
pytest.mark.xfail(raises=subprocess.CalledProcessError))
elif backend == "wx":
param.marks.append(
pytest.mark.xfail(raises=subprocess.CalledProcessError))
elif backend == "macosx":
param.marks.append(
pytest.mark.xfail(raises=subprocess.TimeoutExpired, strict=True))


@pytest.mark.parametrize("backend", _thread_safe_backends)
Expand Down