test: ignore empty files

Some raw log files may be empty if we cancelled tuhi at the wrong time. Skip
over those while testing

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2019-08-22 09:44:15 +10:00
parent 6c94898458
commit 8690e305cf
1 changed files with 2 additions and 0 deletions

View File

@ -449,6 +449,8 @@ def search_for_tests():
with open(logfile) as fd: with open(logfile) as fd:
try: try:
yml = yaml.load(fd, Loader=yaml.Loader) yml = yaml.load(fd, Loader=yaml.Loader)
if not yml:
continue
timestamp = yml['time'] timestamp = yml['time']
test_name = f'test_log_{timestamp}' test_name = f'test_log_{timestamp}'
test = generator(logfile) test = generator(logfile)