@@ -235,20 +235,28 @@ def thread_draw_work():
235
235
raise exc_info[1].with_traceback(exc_info[2])
236
236
"""
237
237
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 )
240
253
@pytest .mark .flaky (reruns = 3 )
241
254
def test_interactive_thread_safety (backend ):
242
255
proc = subprocess .run (
243
256
[sys .executable , "-c" , _thread_test_script ],
244
257
env = {** os .environ , "MPLBACKEND" : backend , "SOURCE_DATE_EPOCH" : "0" },
245
- timeout = _test_timeout ,
258
+ timeout = _test_timeout , check = True ,
246
259
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 } ." )
252
260
assert proc .stdout .count ("CloseEvent" ) == 1
253
261
254
262
0 commit comments