Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f809ee5

Browse files
committed
Skip Tkinter tests with threading on PyPy.
It does not support calls to Tkinter from different threads: https://foss.heptapod.net/pypy/pypy/-/issues/1929
1 parent 8c3dbd7 commit f809ee5

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lib/matplotlib/tests/test_backend_tk.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import functools
22
import inspect
33
import os
4+
import platform
45
import re
56
import subprocess
67
import sys
@@ -111,6 +112,9 @@ def legitimate_quit():
111112
print("success")
112113

113114

115+
@pytest.mark.skipif(platform.python_implementation() != 'CPython',
116+
reason='PyPy does not support Tkinter threading: '
117+
'https://foss.heptapod.net/pypy/pypy/-/issues/1929')
114118
@pytest.mark.backend('TkAgg', skip_on_importerror=True)
115119
@pytest.mark.flaky(reruns=3)
116120
@_isolated_tk_test(success_count=1)

lib/matplotlib/tests/test_backends_interactive.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import inspect
44
import json
55
import os
6+
import platform
67
import signal
78
import subprocess
89
import sys
@@ -220,6 +221,12 @@ def _test_thread_impl():
220221
elif param.values[0].get("QT_API") == "PySide2":
221222
param.marks.append(
222223
pytest.mark.xfail(raises=subprocess.CalledProcessError))
224+
elif backend == "tkagg" and platform.python_implementation() != 'CPython':
225+
param.marks.append(
226+
pytest.mark.xfail(
227+
reason='PyPy does not support Tkinter threading: '
228+
'https://foss.heptapod.net/pypy/pypy/-/issues/1929',
229+
strict=True))
223230

224231

225232
@pytest.mark.parametrize("env", _thread_safe_backends)

0 commit comments

Comments
 (0)