Skip to content

Commit 79284df

Browse files
committed
Show more detail of failed process
1 parent 4c4dadd commit 79284df

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

t/run_yaml_test.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,21 @@ def run_case(case):
8282
command = ['perl', '-Mblib', 'ack', '--noenv']
8383
command += args.split()
8484
logger.info(' Command: %s' % ' '.join(command))
85-
result = subprocess.run(
86-
command,
87-
input=case.get('stdin', None),
88-
capture_output=True,
89-
text=True,
90-
check=(not case['exitcode']),
91-
)
85+
86+
try:
87+
result = subprocess.run(
88+
command,
89+
input=case.get('stdin', None),
90+
capture_output=True,
91+
text=True,
92+
check=(not case['exitcode']),
93+
)
94+
except subprocess.CalledProcessError as e:
95+
print('STDOUT from', command)
96+
print(repr(e.stdout))
97+
print('STDERR from', command)
98+
print(repr(e.stderr))
99+
raise
92100

93101
if case['exitcode']:
94102
assert result.returncode == case['exitcode']

0 commit comments

Comments
 (0)