Skip to content

Commit

Permalink
Move example Test definition out of the main() function to module level.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 647501065
  • Loading branch information
glados-verma authored and Copybara-Service committed Jun 28, 2024
1 parent 865512a commit 0b306f2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/all_the_things.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ def teardown(test):
test.logger.info('Running teardown')


def main():
test = htf.Test(
def make_test():
return htf.Test(
htf.PhaseGroup.with_teardown(teardown)(
hello_world,
set_measurements,
Expand All @@ -180,6 +180,10 @@ def main():
test_name='MyTest',
test_description='OpenHTF Example Test',
test_version='1.0.0')


def main():
test = make_test()
test.add_output_callbacks(
callbacks.OutputToFile(
'./{dut_id}.{metadata[test_name]}.{start_time_millis}.pickle'))
Expand Down

0 comments on commit 0b306f2

Please sign in to comment.