Skip to content

Commit 3c503df

Browse files
committed
TST: run test that might crash in a subprocess
1 parent 060fa00 commit 3c503df

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/matplotlib/tests/test_backend_macosx.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ def test_save_figure_return():
8787
extra_env={"MPLBACKEND": "macosx"})
8888

8989

90-
@pytest.mark.backend('macosx', skip_on_importerror=True)
91-
def test_create_figure_on_worker_thread_fails():
92-
90+
def _test_create_figure_on_worker_thread_fails():
9391
def create_figure():
9492
warn_msg = "Matplotlib GUI outside of the main thread will likely fail."
9593
err_msg = "Cannot create a GUI FigureManager outside the main thread"
@@ -100,3 +98,12 @@ def create_figure():
10098
worker = threading.Thread(target=create_figure)
10199
worker.start()
102100
worker.join()
101+
102+
103+
@pytest.mark.backend('macosx', skip_on_importerror=True)
104+
def test_create_figure_on_worker_thread_fails():
105+
subprocess_run_helper(
106+
_test_create_figure_on_worker_thread_fails,
107+
timeout=_test_timeout,
108+
extra_env={"MPLBACKEND": "macosx"}
109+
)

0 commit comments

Comments
 (0)