Skip to content

Commit

Permalink
Ensure the termination of the teardown_class record. (#864)
Browse files Browse the repository at this point in the history
  • Loading branch information
xpconanfan authored Jan 13, 2023
1 parent f7f323e commit 1c44fd9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions mobly/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ def _teardown_class(self):
records.TestSummaryEntryType.RECORD)
else:
if expects.recorder.has_error:
record.test_error()
record.update_record()
self.results.add_class_error(record)
self.summary_writer.dump(record.to_dict(),
Expand Down
1 change: 1 addition & 0 deletions tests/mobly/base_test_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1728,6 +1728,7 @@ def teardown_class(self):
self.assertEqual(actual_record.test_name, 'teardown_class')
self.assertEqual(actual_record.details, MSG_EXPECTED_EXCEPTION)
self.assertEqual(actual_record.extras, MOCK_EXTRA)
self.assertIsNotNone(actual_record.end_time)

def test_expect_in_setup_test(self):
must_call = mock.Mock()
Expand Down

0 comments on commit 1c44fd9

Please sign in to comment.