From 4da387ee8d2437a04cb46e9def24baff28d03cdb Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Tue, 24 May 2022 09:47:15 +0200 Subject: [PATCH] Backport PR #23095: Try to unbreak CI by xfailing OSX Tk tests Try to unbreak CI by xfailing OSX Tk tests (#23095) * Try to unbreak CI by xfailing OSX Tk tests Stopgap solution for #23094 * Update lib/matplotlib/tests/test_backend_tk.py * Update lib/matplotlib/tests/test_backend_tk.py Co-authored-by: Oscar Gustafsson (cherry picked from commit d6ee414ec175870b9fe8c65297e6c56114fe19a3) --- lib/matplotlib/tests/test_backend_tk.py | 4 ++++ lib/matplotlib/tests/test_backends_interactive.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/lib/matplotlib/tests/test_backend_tk.py b/lib/matplotlib/tests/test_backend_tk.py index e6f78e435138..b51c8d99e835 100644 --- a/lib/matplotlib/tests/test_backend_tk.py +++ b/lib/matplotlib/tests/test_backend_tk.py @@ -31,6 +31,10 @@ def _isolated_tk_test(success_count, func=None): # Remove decorators. source = re.search(r"(?ms)^def .*", inspect.getsource(func)).group(0) + @pytest.mark.xfail( # GitHub issue #23094 + sys.platform == 'darwin', + reason="Tk version mismatch on OSX CI" + ) @functools.wraps(func) def test_func(): try: diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py index e484807789d4..72b41c7ec7ab 100644 --- a/lib/matplotlib/tests/test_backends_interactive.py +++ b/lib/matplotlib/tests/test_backends_interactive.py @@ -59,6 +59,9 @@ def _get_testable_interactive_backends(): elif env["MPLBACKEND"].startswith('wx') and sys.platform == 'darwin': # ignore on OSX because that's currently broken (github #16849) marks.append(pytest.mark.xfail(reason='github #16849')) + elif env["MPLBACKEND"] == "tkagg" and sys.platform == 'darwin': + marks.append( # GitHub issue #23094 + pytest.mark.xfail(reason="Tk version mismatch on OSX CI")) envs.append(pytest.param(env, marks=marks, id=str(env))) return envs @@ -231,6 +234,9 @@ def _test_thread_impl(): reason='PyPy does not support Tkinter threading: ' 'https://foss.heptapod.net/pypy/pypy/-/issues/1929', strict=True)) + elif backend == "tkagg" and sys.platform == "darwin": + param.marks.append( # GitHub issue #23094 + pytest.mark.xfail("Tk version mismatch on OSX CI")) @pytest.mark.parametrize("env", _thread_safe_backends)