Skip to content

Commit 6060cd0

Browse files
glados-vermacopybara-github
authored andcommitted
Move example Test definition out of the main() function to module level.
PiperOrigin-RevId: 648569333
1 parent 71e03cb commit 6060cd0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/all_the_things.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ def teardown(test):
162162
test.logger.info('Running teardown')
163163

164164

165-
def main():
166-
test = htf.Test(
165+
def make_test():
166+
return htf.Test(
167167
htf.PhaseGroup.with_teardown(teardown)(
168168
hello_world,
169169
set_measurements,
@@ -180,6 +180,10 @@ def main():
180180
test_name='MyTest',
181181
test_description='OpenHTF Example Test',
182182
test_version='1.0.0')
183+
184+
185+
def main():
186+
test = make_test()
183187
test.add_output_callbacks(
184188
callbacks.OutputToFile(
185189
'./{dut_id}.{metadata[test_name]}.{start_time_millis}.pickle'))

0 commit comments

Comments
 (0)