Skip to content

Commit a1449e0

Browse files
OpenHTF Ownerscopybara-github
OpenHTF Owners
authored andcommitted
Added pytype None checks to text.py.
PiperOrigin-RevId: 609710498
1 parent 72a2e31 commit a1449e0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

openhtf/util/text.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ def _GetTestOutcomeHeadline(record: test_record.TestRecord,
9898
Returns:
9999
Text headline of the test result.
100100
"""
101+
102+
if record.outcome is None:
103+
return 'No Outcome Set'
104+
101105
# TODO(b/70517332): Pytype currently doesn't properly support the functional
102106
# API of enums: https://github.com/google/pytype/issues/459. Remove
103107
# disabling pytype once fixed.
@@ -200,7 +204,8 @@ def StringFromPhaseRecord(
200204
Text summary of the phase record.
201205
"""
202206
output = []
203-
207+
if phase.outcome is None:
208+
return 'No Outcome Set'
204209
text = 'Phase {}\n+ Outcome: {} Result: {}'.format(
205210
phase.name, phase.outcome.name,
206211
StringFromPhaseExecutionOutcome(phase.result))

0 commit comments

Comments
 (0)