mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 19:21:01 +00:00
test.py: Return test output only if subprocess succeeded
The current code will try to print the output of a subprocess.Popen().communicate() call even if that call raised an exception and that output is None. Let's fix this problem by only printing the output if it's not None. Signed-off-by: Lucas Meneghel Rodrigues <lmr@scylladb.com>
This commit is contained in:
committed by
Avi Kivity
parent
5cdbc3701a
commit
42c0acfc44
7
test.py
7
test.py
@@ -149,9 +149,10 @@ if __name__ == "__main__":
|
||||
print_status('TIMED OUT\n')
|
||||
else:
|
||||
print_status(' with error code {code}\n'.format(code=proc.returncode))
|
||||
print('=== stdout START ===')
|
||||
print(str(out, encoding='UTF-8'))
|
||||
print('=== stdout END ===')
|
||||
if out is not None:
|
||||
print('=== stdout START ===')
|
||||
print(str(out, encoding='UTF-8'))
|
||||
print('=== stdout END ===')
|
||||
all_ok = False
|
||||
else:
|
||||
print_status('%s PASSED %s' % (prefix, path))
|
||||
|
||||
Reference in New Issue
Block a user