Skip to content

Commit

Permalink
python-tests: Exit test from one point
Browse files Browse the repository at this point in the history
It is always better to have a single return/exit
from a function/test in which it would be easier for
users to understand.

Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>
  • Loading branch information
AhmedIsmail02 authored and urutva committed May 23, 2024
1 parent a8f20fc commit be29b1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tools/tests/test_applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def test_applications(
if index == len(pass_output):
break
for x in fail_output:
assert x not in line
if x in line:
break
current_time = timer()

assert index == len(pass_output)
3 changes: 2 additions & 1 deletion tools/tests/test_blinky_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def test_blinky_output(
if index == len(pass_output):
break
for x in fail_output:
assert x not in line
if x in line:
break
current_time = timer()

assert index == len(pass_output)

0 comments on commit be29b1b

Please sign in to comment.