Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 126507f

Browse files
Show subprocess stdout and stderr on pytest failure
1 parent 7e997ae commit 126507f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎lib/matplotlib/testing/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ def subprocess_run_for_testing(command, env=None, timeout=60, stdout=None,
105105
import pytest
106106
pytest.xfail("Fork failure")
107107
raise
108+
except subprocess.CalledProcessError as e:
109+
if e.stdout:
110+
_log.error(f"Subprocess output:\n{e.stdout}")
111+
if e.stderr:
112+
_log.error(f"Subprocess error:\n{e.stderr}")
113+
raise e
114+
if proc.stdout:
115+
_log.debug(f"Subprocess output:\n{proc.stdout}")
116+
if proc.stderr:
117+
_log.debug(f"Subprocess error:\n{proc.stderr}")
108118
return proc
109119

110120

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /