8000 Better behavior in case of timeout · matplotlib/matplotlib@1b3d407 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1b3d407

Browse files
Better behavior in case of timeout
1 parent fe5c12b commit 1b3d407

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/matplotlib/tests/test_backend_tk.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def legitimate_quit():
7373
else:
7474
assert proc.stdout.count("success") == 1
7575

76+
7677
@pytest.mark.backend('TkAgg', skip_on_importerror=True)
7778
@pytest.mark.flaky(reruns=3)
7879
def test_figuremanager_cleans_own_mainloop():
@@ -151,18 +152,18 @@ def test_never_update():
151152
env={**os.environ, "SOURCE_DATE_EPOCH": "0"},
152153
timeout=_test_timeout,
153154
capture_output=True,
154-
check=True,
155155
universal_newlines=True,
156156
)
157-
except subprocess.CalledProcessError:
158-
pytest.fail("Subprocess failed to test intended behavior")
157+
except subprocess.TimeoutExpired:
158+
pytest.fail("Subprocess timed out")
159159
else:
160160
# test framework doesn't see tkinter callback exceptions normally
161161
# see tkinter.Misc.report_callback_exception
162162
assert "Exception in Tkinter callback" not in proc.stderr
163-
finally:
164163
# make sure we can see other issues
165164
print(proc.stderr, file=sys.stderr)
165+
if proc.returncode:
166+
pytest.fail("Subprocess failed to test intended behavior")
166167

167168

168169
@pytest.mark.backend('TkAgg', skip_on_importerror=True)

0 commit comments

Comments
 (0)
0