Skip to content

Commit f9a0fac

Browse files
committed
fix(pytest): do not fail if the default TEST_IMAGE cannot be found
Target in our pytest module expects the image specified in the TEST_IMAGE environment variable (or its default value) to exist. No longer fail if an image is not specified in the environment and if the default one could not be found: this may be intented. Signed-off-by: Cedric Hombourger <[email protected]>
1 parent 025b9f7 commit f9a0fac

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

mtda/pytest.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,16 @@ def init():
4343
# Initialize boot media
4444
image = os.getenv("TEST_IMAGE", Consts.DEFAULT_IMAGE)
4545
if os.path.exists(image) is False:
46-
return False
46+
if image != Consts.DEFAULT_IMAGE:
47+
return False
48+
else:
49+
image = ""
4750

48-
Storage.to_host()
49-
Storage.write(image)
50-
Storage.to_target()
51-
Env.set("boot-from-usb", "1")
51+
if image:
52+
Storage.to_host()
53+
Storage.write(image)
54+
Storage.to_target()
55+
Env.set("boot-from-usb", "1")
5256

5357
return True
5458

0 commit comments

Comments
 (0)