Skip to content

Commit be29b1b

Browse files
AhmedIsmail02urutva
authored andcommitted
python-tests: Exit test from one point
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 <[email protected]>
1 parent a8f20fc commit be29b1b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tools/tests/test_applications.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ def test_applications(
6969
if index == len(pass_output):
7070
break
7171
for x in fail_output:
72-
assert x not in line
72+
if x in line:
73+
break
7374
current_time = timer()
7475

7576
assert index == len(pass_output)

tools/tests/test_blinky_output.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def test_blinky_output(
4545
if index == len(pass_output):
4646
break
4747
for x in fail_output:
48-
assert x not in line
48+
if x in line:
49+
break
4950
current_time = timer()
5051

5152
assert index == len(pass_output)

0 commit comments

Comments
 (0)