Skip to content

Commit

Permalink
move log to inner function
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az committed May 12, 2024
1 parent f216af9 commit a482695
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions unit-tests/run-unit-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ def test_wrapper_( test, configuration=None, repetition=1, retry=0, sns=None ):
if rslog:
opts.add( '--rslog' )
try:
if repetition > 0:
log.d("repeat #", repetition + 1)
test.run_test( configuration = configuration, log_path = log_path, opts = opts )
except FileNotFoundError as e:
log.e( log.red + test.name + log.reset + ':', str( e ) + configuration_str( configuration, repetition, prefix=' ' ) )
Expand Down Expand Up @@ -560,8 +562,6 @@ def test_wrapper( test, configuration=None, repetition=1, sns=None ):
test_ok = True
for repetition in range(repeat):
test_ok = test_wrapper( test, repetition = repetition ) and test_ok
if repetition + 1 < repeat:
log.d("repeating #", repetition + 1)
if not test_ok:
failed_tests.append( test )
continue
Expand All @@ -585,8 +585,6 @@ def test_wrapper( test, configuration=None, repetition=1, sns=None ):
log.w( log.red + test.name + log.reset + ': ' + str( e ) )
else:
test_ok = test_wrapper( test, configuration, repetition, sns=serial_numbers ) and test_ok
if repetition + 1 < repeat:
log.d("repeating #", repetition + 1)
finally:
log.debug_unindent()
if not test_ok:
Expand Down

0 comments on commit a482695

Please sign in to comment.