From c78bdf955a6ed7d5602c96923a98abc37861a006 Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Fri, 22 Apr 2022 19:40:30 +0000 Subject: [PATCH] Don't ignore missing/unreadable files in test cases (pylint) --- tests.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/tests.py b/tests.py index 2600dd8..de8cecf 100755 --- a/tests.py +++ b/tests.py @@ -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: