Don't ignore missing/unreadable files in test cases (pylint)
This commit is contained in:
19
tests.py
19
tests.py
@ -46,17 +46,14 @@ class YAMLTest(unittest.TestCase):
|
|||||||
test = None
|
test = None
|
||||||
cfg = None
|
cfg = None
|
||||||
ncount = 0
|
ncount = 0
|
||||||
try:
|
with open(self.yaml_filename, "r", encoding="utf-8") as file:
|
||||||
with open(self.yaml_filename, "r", encoding="utf-8") as file:
|
for data in yaml.load_all(file, Loader=yaml.Loader):
|
||||||
for data in yaml.load_all(file, Loader=yaml.Loader):
|
if ncount == 0:
|
||||||
if ncount == 0:
|
test = data
|
||||||
test = data
|
ncount += 1
|
||||||
ncount += 1
|
elif ncount == 1:
|
||||||
elif ncount == 1:
|
cfg = data
|
||||||
cfg = data
|
ncount += 1
|
||||||
ncount += 1
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
self.assertEqual(ncount, 2)
|
self.assertEqual(ncount, 2)
|
||||||
self.assertIsNotNone(test)
|
self.assertIsNotNone(test)
|
||||||
if not cfg:
|
if not cfg:
|
||||||
|
Reference in New Issue
Block a user