Skip to content

Commit f3fadf9

Browse files
glados-vermacopybara-github
authored andcommitted
Refactor TestDutId as a public constant.
PiperOrigin-RevId: 758772358
1 parent 61c4319 commit f3fadf9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

openhtf/util/test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ def test_multiple(self, mock_my_plug):
174174

175175
logs.CLI_LOGGING_VERBOSITY = 2
176176

177+
# TestApi.dut_id attribute when running unit tests with the module-supplied
178+
# test start function.
179+
TEST_DUT_ID = 'TestDutId'
180+
177181

178182
# Maximum number of measurements per phase to be printed to the assertion
179183
# error message for test failures.
@@ -674,7 +678,7 @@ def setUp(self):
674678
self.last_test_state = None
675679
# When a test is yielded, this function is provided to as the test_start
676680
# argument to test.execute.
677-
self.test_start_function = lambda: 'TestDutId'
681+
self.test_start_function = lambda: TEST_DUT_ID
678682
# Dictionary mapping plug class (type, not instance) to plug instance.
679683
# Prior to executing a phase or test, plug instances can be added here.
680684
# When a OpenHTF phase or test is run in this suite, any instantiated plugs

0 commit comments

Comments
 (0)