Skip to content

Commit

Permalink
Fix stamp file creation for zap unit test. (#27296)
Browse files Browse the repository at this point in the history
unittest.main by default calls sys.exit so we did not get a chance
to create the stamp file.

Fix this and handle sys exit logic separately.

Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Sep 14, 2023
1 parent ba30363 commit 4635153
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/tools/zap/test_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ def process_arguments():

PROGRAM_ARGUMENTS = process_args

unittest.main(argv=unittest_args)
test_results = unittest.main(argv=unittest_args, exit=False)
if test_results.result.failures:
sys.exit(1)

if process_args.stamp_file:
open(process_args.stamp_file, "wb").close()

0 comments on commit 4635153

Please sign in to comment.