Module Expr Str Import alias Import alias ImportFrom alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Call NameLoad Str ListLoad Str Str Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Dict Str Str Str Str Str AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr ListComp TupleLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr comprehension NameStore AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Return AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad AttributeLoad Call NameLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad Call NameLoad AttributeLoad NameLoad attr attr Str Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr orelse If AttributeLoad NameLoad attr body Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr orelse If CompareEq AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr body Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Return CompareEq AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If Call NameLoad GeneratorExp CompareNotEq AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr comprehension NameStore AttributeLoad AttributeLoad NameLoad attr attr comprehension NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr orelse Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad AttributeLoad NameLoad attr attr body Raise Call NameLoad Str AttributeLoad AttributeLoad NameLoad attr attr If UnaryOpNot AttributeLoad AttributeLoad NameLoad attr attr body Raise Call NameLoad Str If UnaryOpNot AttributeLoad AttributeLoad NameLoad attr attr body Raise Call NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad AttributeLoad Call NameLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr decorator_list Assign NameStore NameLoad decorator_list
N/A N/A TestState module for handling the lifetime of a test.

Test timing, failures, and the UI are handled by this module.
 N/A json N/A logging enum Enum N/A openhtf openhtf util openhtf.exe phase_data openhtf.io test_record openhtf.util data openhtf.util logs openhtf.util measurements N/A _LOG N/A N/A logging getLogger __name__ BlankDutIdError N/A Exception N/A N/A DUT serial cannot be blank at the end of a test. N/A FrameworkError N/A Exception N/A N/A Raised when we end up in an invalid internal state somehow. N/A TestRecordAlreadyFinishedError N/A Exception N/A N/A Raised when trying to finalize a test record that is already finished. N/A TestState N/A object N/A N/A This class handles tracking the state of the test.

  Args:
    test_data: openhtf.TestData instance describing the test to run.
    plug_map: dict mapping plug type to instance.
    dut_id: DUT identifier, if it's known, otherwise None.
    station_id: Station identifier.
   N/A State N/A Enum State N/A CREATED RUNNING COMPLETED __init__ N/A N/A self test_data plug_map dut_id station_id N/A N/A N/A N/A self _state N/A N/A self State CREATED N/A N/A self record N/A N/A test_record TestRecord dut_id dut_id station_id station_id code_info N/A test_data code_info metadata N/A test_data metadata N/A N/A self logger N/A N/A logging getLogger N/A logs RECORD_LOGGER N/A N/A self _record_handler N/A N/A logs RecordHandler N/A self record N/A N/A N/A N/A self logger addHandler N/A self _record_handler N/A N/A self phase_data N/A N/A phase_data PhaseData N/A self logger plug_map N/A self record N/A N/A self running_phase_record None N/A N/A self pending_phases N/A list N/A test_data phases N/A __del__ N/A N/A self N/A N/A N/A N/A N/A N/A self logger removeHandler N/A self _record_handler N/A AsJSON N/A N/A self N/A N/A N/A Return JSON representation of the test's serialized state. N/A N/A N/A json dumps N/A N/A data ConvertToBaseTypes self N/A _asdict N/A N/A self N/A N/A N/A Return a dict representation of the test's state. N/A N/A status record phase_data running_phase_record pending_phases N/A N/A self _state name N/A self record N/A self phase_data N/A self running_phase_record N/A N/A N/A N/A phase func __name__ N/A N/A phase func __doc__ N/A phase N/A self pending_phases N/A GetLastRunPhaseName N/A N/A self N/A N/A N/A Get the name of the currently running phase, or None.

    Note that this name is not guaranteed to still be accurate by the time this
    method returns, so this should only be used for log messages/user display
    and not for programmatic purposes.
     N/A N/A self running_phase_record N/A N/A N/A N/A self running_phase_record name N/A None N/A SetStateFromPhaseOutcome N/A N/A self phase_outcome N/A N/A N/A Set our internal state based on the given phase outcome.

    Args:
      phase_outcome: An instance of phase_executor.PhaseOutcome

    Returns: True if the test has finished prematurely (failed).
     N/A N/A phase_outcome raised_exception N/A N/A N/A N/A self record outcome N/A N/A test_record Outcome ERROR N/A code N/A str N/A N/A type N/A phase_outcome phase_result __name__ N/A description N/A N/A N/A str N/A phase_outcome phase_result decode utf8 replace N/A N/A N/A N/A self record AddOutcomeDetails code description N/A N/A self _state N/A N/A self State COMPLETED N/A N/A N/A phase_outcome is_timeout N/A N/A N/A N/A self record outcome N/A N/A test_record Outcome TIMEOUT N/A N/A self _state N/A N/A self State COMPLETED N/A N/A N/A N/A phase_outcome phase_result N/A N/A openhtf PhaseResult FAIL N/A N/A N/A N/A self record outcome N/A N/A test_record Outcome FAIL N/A N/A self _state N/A N/A self State COMPLETED N/A N/A N/A self _state N/A N/A self State COMPLETED N/A SetStateRunning N/A N/A self N/A N/A N/A Mark the test as actually running (as opposed to CREATED). N/A N/A self _state N/A N/A self State RUNNING N/A SetStateFinished N/A N/A self N/A N/A N/A Mark the state as finished, only called if the test ended normally. N/A N/A any N/A N/A N/A meas outcome N/A N/A measurements Outcome PASS N/A phase N/A N/A self record phases N/A meas N/A N/A N/A phase measurements itervalues N/A N/A N/A N/A self record outcome N/A N/A test_record Outcome FAIL N/A N/A N/A N/A self record outcome N/A N/A test_record Outcome PASS N/A GetFinishedRecord N/A N/A self N/A N/A N/A Get a test_record.TestRecord for the finished test.

    Should only be called once at the conclusion of a test run, and will raise
    an exception if end_time_millis is already set.

    Returns:  An updated test_record.TestRecord that is ready for output.

    Raises: TestRecordAlreadyFinishedError if end_time_millis already set.
     N/A N/A N/A self record end_time_millis N/A N/A N/A TestRecordAlreadyFinishedError Test already finished at N/A N/A self record end_time_millis N/A N/A N/A N/A self record dut_id N/A N/A N/A BlankDutIdError Blank or missing DUT ID, HTF requires a non-blank ID. N/A N/A N/A N/A self record outcome N/A N/A N/A FrameworkError Internal framework error, test outcome unset! N/A N/A N/A N/A self logger debug Finishing test execution with outcome %s. N/A N/A N/A self record outcome name N/A N/A N/A self record end_time_millis N/A N/A util TimeMillis N/A N/A N/A N/A self logger removeHandler N/A self _record_handler N/A N/A self record N/A __str__ N/A N/A self N/A N/A N/A N/A <%s: %s@%s Running Phase: %s> N/A N/A N/A type self __name__ N/A N/A self record dut_id N/A N/A self record station_id N/A N/A self GetLastRunPhaseName N/A N/A __repr__ __str__ N/A