Don't ignore missing/unreadable files in test cases (pylint)

This commit is contained in:
Pim van Pelt
2022-04-22 19:40:30 +00:00
parent 5a30d9d995
commit c78bdf955a

View File

@ -46,17 +46,14 @@ class YAMLTest(unittest.TestCase):
test = None
cfg = None
ncount = 0
try:
with open(self.yaml_filename, "r", encoding="utf-8") as file:
for data in yaml.load_all(file, Loader=yaml.Loader):
if ncount == 0:
test = data
ncount += 1
elif ncount == 1:
cfg = data
ncount += 1
except:
pass
with open(self.yaml_filename, "r", encoding="utf-8") as file:
for data in yaml.load_all(file, Loader=yaml.Loader):
if ncount == 0:
test = data
ncount += 1
elif ncount == 1:
cfg = data
ncount += 1
self.assertEqual(ncount, 2)
self.assertIsNotNone(test)
if not cfg: