def GetFinishedRecord(self):
    if self.record.end_time_millis:
      raise TestRecordAlreadyFinishedError('Test already finished at',
                                           self.record.end_time_millis)

    if not self.record.dut_id:
      raise BlankDutIdError(
          'Blank or missing DUT ID, HTF requires a non-blank ID.')

    if not self.record.outcome:
      raise FrameworkError(
          'Internal framework error, test outcome unset!')

    self.logger.debug('Finishing test execution with outcome %s.',
                      self.record.outcome.name)

    self.record.end_time_millis = util.TimeMillis()
    self.logger.removeHandler(self._record_handler)
    return self.record
Get a test_record.TestRecord for the finished test.
dataset/ETHPy150Open google/openhtf/openhtf/exe/test_state.py/TestState.GetFinishedRecord