8000 Backport PR #12036 on branch v3.0.x (Interactive tests update) by meeseeksmachine · Pull Request #12063 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Backport PR #12036 on branch v3.0.x (Interactive tests update) #12063

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
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
25 changes: 12 additions & 13 deletions lib/matplotlib/tests/test_backends_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,21 @@

def _get_testable_interactive_backends():
backends = []
# gtk3agg fails on Travis, needs to be investigated.
for deps, backend in [ # (["cairocffi", "pgi"], "gtk3agg"),
(["cairocffi", "pgi"], "gtk3cairo"),
(["PyQt5"], "qt5agg"),
(["PyQt5", "cariocffi"], "qt5cairo"),
(["tkinter"], "tkagg"),
(["wx"], "wx"),
(["wx"], "wxagg")
for deps, backend in [
# gtk3agg fails on Travis, needs to be investigated.
# (["cairocffi", "pgi"], "gtk3agg"),
(["cairocffi", "pgi"], "gtk3cairo"),
(["PyQt5"], "qt5agg"),
(["PyQt5", "cairocffi"], "qt5cairo"),
(["tkinter"], "tkagg"),
(["wx"], "wx"),
(["wx"], "wxagg"),
]:
reason = None
if not os.environ.get("DISPLAY"):
reason = "No $DISPLAY"
elif any(importlib.util.find_spec(dep) is None for dep in deps):
reason = "Missing dependency"
elif "wx" in deps and sys.platform == "darwin":
reason = "wx backends known not to work on OSX"
backends.append(pytest.mark.skip(reason=reason)(backend) if reason
else backend)
return backends
Expand Down Expand Up @@ -67,9 +66,9 @@ def _get_testable_interactive_backends():
# framework, but can switch to a backend using cairo instead of agg, or a
# non-interactive backend. In the first case, we use tkagg as the "other"
# interactive backend as it is (essentially) guaranteed to be present.
# Moreover, don't test switching away from gtk3 as Gtk.main_level() is
# not set up at this point yet, and webagg, which uses no interactive
# framework.
# Moreover, don't test switching away from gtk3 (as Gtk.main_level() is
# not set up at this point yet) and webagg (which uses no interactive
# framework).

if backend != "tkagg":
with assert_raises(ImportError):
Expand Down
0