Skip to content

Commit d008a8c

Browse files
committed
tests: fix console_data if not under screen
In commit 059aa62 we started gathering console_data if a test failed. However console_data errors if we were not using screen in the first place. Fixes: 059aa62 Signed-off-by: Pablo Barbáchano <[email protected]>
1 parent db52aef commit d008a8c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/framework/microvm.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,10 @@ def console_data(self):
411411
"""Return the output of microVM's console"""
412412
if self.screen_log is None:
413413
return None
414-
return Path(self.screen_log).read_text(encoding="utf-8")
414+
file = Path(self.screen_log)
415+
if not file.exists():
416+
return None
417+
return file.read_text(encoding="utf-8")
415418

416419
@property
417420
def state(self):

0 commit comments

Comments
 (0)