8000 ignore -> xfail for wx and macosx · matplotlib/matplotlib@bbb82ac · GitHub
[go: up one dir, main page]

Skip to content

Commit bbb82ac

Browse files
ignore -> xfail for wx and macosx
1 parent fd97233 commit bbb82ac

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

lib/matplotlib/tests/test_backends_interactive.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,20 +235,28 @@ def thread_draw_work():
235235
raise exc_info[1].with_traceback(exc_info[2])
236236
"""
237237

238-
239-
@pytest.mark.parametrize("backend", _get_testable_interactive_backends())
238+
_thread_safe_backends = _get_testable_interactive_backends()
239+
# Known unsafe backends. Remove the xfails if they start to pass!
240+
if "wx" in _thread_safe_backends:
241+
_thread_safe_backends.remove("wx")
242+
_thread_safe_backends.append(
243+
pytest.param("wx", marks=pytest.mark.xfail(
244+
raises=subprocess.CalledProcessError, strict=True)))
245+
if "macosx" in _thread_safe_backends:
246+
_thread_safe_backends.remove("macosx")
247+
_thread_safe_backends.append(
248+
pytest.param("macosx", marks=pytest.mark.xfail(
249+
raises=subprocess.TimeoutExpired, strict=True)))
250+
251+
252+
@pytest.mark.parametrize("backend", _thread_safe_backends)
240253
@pytest.mark.flaky(reruns=3)
241254
def test_interactive_thread_safety(backend):
242255
proc = subprocess.run(
243256
[sys.executable, "-c", _thread_test_script],
244257
env={**os.environ, "MPLBACKEND": backend, "SOURCE_DATE_EPOCH": "0"},
245-
timeout=_test_timeout,
258+
timeout=_test_timeout, check=True,
246259
stdout=subprocess.PIPE, universal_newlines=True)
247-
if proc.returncode:
248-
if backend == "wx":
249-
pytest.xfail("Ignoring deprecated wx failure. Use wxagg.")
250-
pytest.fail("The subprocess returned with non-zero exit status "
251-
f"{proc.returncode}.")
252260
assert proc.stdout.count("CloseEvent") == 1
253261

254262

0 commit comments

Comments
 (0)
0