Handle a skipped test without a reason message
This commit fixes a bug in subunit-trace where if a test is skipped but does not have a reason associated with the skip it would stack trace. This checks for the existence of a reason before trying to use it. Change-Id: I14dd9fbb40a8c232431e5042aa46f7e521e15311
This commit is contained in:
parent
dcb8ea833c
commit
b351bc6c8f
@ -194,8 +194,11 @@ def show_outcome(stream, test, print_failures=False, failonly=False,
|
|||||||
if abbreviate:
|
if abbreviate:
|
||||||
stream.write('S')
|
stream.write('S')
|
||||||
else:
|
else:
|
||||||
stream.write('{%s} %s ... SKIPPED: %s\n' % (
|
reason = test['details'].get('reason', '')
|
||||||
worker, name, test['details']['reason'].as_text()))
|
if reason:
|
||||||
|
reason = ': ' + reason.as_text()
|
||||||
|
stream.write('{%s} %s ... SKIPPED%s\n' % (
|
||||||
|
worker, name, reason))
|
||||||
else:
|
else:
|
||||||
if abbreviate:
|
if abbreviate:
|
||||||
stream.write('%s' % test['status'][0])
|
stream.write('%s' % test['status'][0])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user