Skip to content

Commit

Permalink
Added pytype None checks to text.py.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 608989742
  • Loading branch information
OpenHTF Owners authored and copybara-github committed Feb 21, 2024
1 parent 72a2e31 commit 0724d28
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion openhtf/util/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ def _GetTestOutcomeHeadline(record: test_record.TestRecord,
Returns:
Text headline of the test result.
"""

if record.outcome is None:
return 'No Outcome Set'

# TODO(b/70517332): Pytype currently doesn't properly support the functional
# API of enums: https://github.com/google/pytype/issues/459. Remove
# disabling pytype once fixed.
Expand Down Expand Up @@ -200,7 +204,8 @@ def StringFromPhaseRecord(
Text summary of the phase record.
"""
output = []

if phase.outcome is None:
return 'No Outcome Set'
text = 'Phase {}\n+ Outcome: {} Result: {}'.format(
phase.name, phase.outcome.name,
StringFromPhaseExecutionOutcome(phase.result))
Expand Down

0 comments on commit 0724d28

Please sign in to comment.