Fix pylint warnings in testcase_base 53/31853/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Sun, 26 Mar 2017 09:55:10 +0000 (11:55 +0200)
committerMorgan Richomme <morgan.richomme@orange.com>
Mon, 27 Mar 2017 06:48:04 +0000 (06:48 +0000)
It takes into account the following warnings:
  - bare-except
  - unused-argument
  - broad-except

Change-Id: I3a50bf6d07823edc80a7f0f78f46681ace7f4a39
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit e4d7506a5a21550a89f897dfaea3f0dcae352e5b)

functest/core/testcase_base.py

index 838b639..2848073 100644 (file)
@@ -35,11 +35,12 @@ class TestcaseBase(object):
             assert self.criteria
             if self.criteria == 'PASS':
                 return TestcaseBase.EX_OK
-        except:
+        except AssertionError:
             self.logger.error("Please run test before checking the results")
         return TestcaseBase.EX_TESTCASE_FAILED
 
     def run(self, **kwargs):
+        # pylint: disable=unused-argument
         self.logger.error("Run must be implemented")
         return TestcaseBase.EX_RUN_ERROR
 
@@ -58,6 +59,6 @@ class TestcaseBase(object):
             else:
                 self.logger.error("The results cannot be pushed to DB")
                 return TestcaseBase.EX_PUSH_TO_DB_ERROR
-        except Exception:
+        except Exception:  # pylint: disable=broad-except
             self.logger.exception("The results cannot be pushed to DB")
             return TestcaseBase.EX_PUSH_TO_DB_ERROR