Use python 3 super() style 51/72651/3
authorVincent Danno <vincent.danno@orange.com>
Wed, 9 Jun 2021 19:29:05 +0000 (21:29 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Thu, 12 Aug 2021 07:46:49 +0000 (09:46 +0200)
See https://www.python.org/dev/peps/pep-3135/

Signed-off-by: Vincent Danno <vincent.danno@orange.com>
Change-Id: I4f74db4a019b70d0289f8969d57fa9ad629c586f

xtesting/core/behaveframework.py
xtesting/core/feature.py
xtesting/core/mts.py
xtesting/core/robotframework.py
xtesting/core/testcase.py
xtesting/core/unit.py
xtesting/core/vnf.py

index ee6e860..3dc6038 100644 (file)
@@ -31,7 +31,7 @@ class BehaveFramework(testcase.TestCase):
     __logger = logging.getLogger(__name__)
 
     def __init__(self, **kwargs):
-        super(BehaveFramework, self).__init__(**kwargs)
+        super().__init__(**kwargs)
         self.json_file = os.path.join(self.res_dir, 'output.json')
         self.total_tests = 0
         self.pass_tests = 0
index 946233d..feae988 100644 (file)
@@ -85,7 +85,7 @@ class BashFeature(Feature):
     __logger = logging.getLogger(__name__)
 
     def __init__(self, **kwargs):
-        super(BashFeature, self).__init__(**kwargs)
+        super().__init__(**kwargs)
         self.result_file = "{}/{}.log".format(self.res_dir, self.case_name)
 
     def execute(self, **kwargs):
index b9f605b..3bc7bde 100644 (file)
@@ -43,7 +43,7 @@ class MTSLauncher(feature.BashFeature):
             self.is_skipped = True
 
     def __init__(self, **kwargs):
-        super(MTSLauncher, self).__init__(**kwargs)
+        super().__init__(**kwargs)
         # Location of the HTML report generated by MTS
         self.mts_stats_dir = os.path.join(self.res_dir, 'mts_stats_report')
         # Location of the log files generated by MTS for each test.
@@ -214,7 +214,7 @@ class MTSLauncher(feature.BashFeature):
             self.__logger.info("MTS logs output dir: %s ", self.mts_logs_dir)
 
             kwargs.pop("cmd", None)
-            return super(MTSLauncher, self).execute(cmd=cmd, **kwargs)
+            return super().execute(cmd=cmd, **kwargs)
 
         except KeyError:
             self.__logger.error("Missing mandatory arg for MTS. kwargs: %s",
index 64ee352..3e3d9de 100644 (file)
@@ -55,7 +55,7 @@ class RobotFramework(testcase.TestCase):
     __logger = logging.getLogger(__name__)
 
     def __init__(self, **kwargs):
-        super(RobotFramework, self).__init__(**kwargs)
+        super().__init__(**kwargs)
         self.xml_file = os.path.join(self.res_dir, 'output.xml')
 
     def parse_results(self):
index 15936f1..672ba3f 100644 (file)
@@ -89,7 +89,7 @@ class TestCase(metaclass=abc.ABCMeta):
             return msg.get_string()
         except AssertionError:
             self.__logger.error("We cannot print invalid objects")
-            return super(TestCase, self).__str__()
+            return super().__str__()
 
     def get_duration(self):
         """Return the duration of the test case.
index 9d549a2..8bcf163 100644 (file)
@@ -32,7 +32,7 @@ class Suite(testcase.TestCase):
     __logger = logging.getLogger(__name__)
 
     def __init__(self, **kwargs):
-        super(Suite, self).__init__(**kwargs)
+        super().__init__(**kwargs)
         self.suite = None
 
     @classmethod
index 8aab233..72d54b5 100644 (file)
@@ -42,7 +42,7 @@ class VnfOnBoarding(testcase.TestCase):
     __logger = logging.getLogger(__name__)
 
     def __init__(self, **kwargs):
-        super(VnfOnBoarding, self).__init__(**kwargs)
+        super().__init__(**kwargs)
         self.uuid = uuid.uuid4()
         self.user_name = "{}-{}".format(self.case_name, self.uuid)
         self.tenant_name = "{}-{}".format(self.case_name, self.uuid)