From 0f85b35ffebde1ca811448624763c1b62935a37b Mon Sep 17 00:00:00 2001 From: OpenHTF Owners Date: Thu, 18 Jan 2024 06:02:49 -0800 Subject: [PATCH] Added pytype None checks to console_summary.py. PiperOrigin-RevId: 599483691 --- openhtf/output/callbacks/console_summary.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openhtf/output/callbacks/console_summary.py b/openhtf/output/callbacks/console_summary.py index 5bc847ca4..3d5ac22e7 100644 --- a/openhtf/output/callbacks/console_summary.py +++ b/openhtf/output/callbacks/console_summary.py @@ -55,9 +55,14 @@ def __init__(self, # pylint: enable=invalid-name def __call__(self, record: test_record.TestRecord) -> None: + if record is None: + raise ValueError('record is None') + outcome = record.outcome + if outcome is None: + raise ValueError('record.outcome is None') output_lines = [ ''.join((self.color_table[record.outcome], self.BOLD, - record.code_info.name, ':', record.outcome.name, self.RESET)) + record.code_info.name, ':', outcome.name, self.RESET)) ] if record.outcome != test_record.Outcome.PASS: for phase in record.phases: