Skip to content

Commit 57d7f45

Browse files
committed
Allow macosx thread safety test on macOS11
It appears to no longer timeout on that system, and is breaking CI, which just switched to it. Note, macOS plays games with the version number it reports depending on how Python was compiled: https://eclecticlight.co/2020/08/13/macos-version-numbering-isnt-so-simple/
1 parent 1f66490 commit 57d7f45

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/matplotlib/tests/test_backends_interactive.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,14 @@ def _test_thread_impl():
222222
param.marks.append(
223223
pytest.mark.xfail(raises=subprocess.CalledProcessError))
224224
elif backend == "macosx":
225-
param.marks.append(
226-
pytest.mark.xfail(raises=subprocess.TimeoutExpired, strict=True))
225+
from packaging.version import parse
226+
mac_ver = platform.mac_ver()[0]
227+
# Note, macOS Big Sur is both 11 and 10.16, depending on SDK that
228+
# Python was compiled against.
229+
if mac_ver and parse(mac_ver) < parse('10.16'):
230+
param.marks.append(
231+
pytest.mark.xfail(raises=subprocess.TimeoutExpired,
232+
strict=True))
227233
elif param.values[0].get("QT_API") == "PySide2":
228234
param.marks.append(
229235
pytest.mark.xfail(raises=subprocess.CalledProcessError))

0 commit comments

Comments
 (0)