[PATCH v2 3/5] dts: unify super calls
Juraj Linkeš
juraj.linkes at pantheon.tech
Wed Jun 19 15:35:24 CEST 2024
We have two ways of calling super() in the codebase. For single
inheritance, there's no benefit in listing the arguments, as the
function will do exactly what we need it to do.
Signed-off-by: Juraj Linkeš <juraj.linkes at pantheon.tech>
Reviewed-by: Luca Vizzarro <luca.vizzarro at arm.com>
Reviewed-by: Patrick Robb <probb at iol.unh.edu>
Reviewed-by: Jeremy Spewock <jspewock at iol.unh.edu>
---
dts/framework/test_result.py | 12 ++++++------
dts/framework/testbed_model/sut_node.py | 2 +-
dts/framework/testbed_model/tg_node.py | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/dts/framework/test_result.py b/dts/framework/test_result.py
index 5deccb6fd4..5694a2482b 100644
--- a/dts/framework/test_result.py
+++ b/dts/framework/test_result.py
@@ -249,7 +249,7 @@ def __init__(self, logger: DTSLogger):
Args:
logger: The logger instance the whole result will use.
"""
- super(DTSResult, self).__init__()
+ super().__init__()
self.dpdk_version = None
self._logger = logger
self._errors = []
@@ -338,7 +338,7 @@ def __init__(self, test_run_config: TestRunConfiguration):
Args:
test_run_config: A test run configuration.
"""
- super(TestRunResult, self).__init__()
+ super().__init__()
self._config = test_run_config
self._test_suites_with_cases = []
@@ -432,7 +432,7 @@ def __init__(
test_suites_with_cases: The test suites with test cases to be run in this build target.
build_target_config: The build target's test run configuration.
"""
- super(BuildTargetResult, self).__init__()
+ super().__init__()
self.arch = build_target_config.arch
self.os = build_target_config.os
self.cpu = build_target_config.cpu
@@ -493,7 +493,7 @@ def __init__(self, test_suite_with_cases: TestSuiteWithCases):
Args:
test_suite_with_cases: The test suite with test cases.
"""
- super(TestSuiteResult, self).__init__()
+ super().__init__()
self.test_suite_name = test_suite_with_cases.test_suite_class.__name__
self._test_suite_with_cases = test_suite_with_cases
@@ -536,7 +536,7 @@ def __init__(self, test_case_name: str):
Args:
test_case_name: The test case's name.
"""
- super(TestCaseResult, self).__init__()
+ super().__init__()
self.test_case_name = test_case_name
def update(self, result: Result, error: Exception | None = None) -> None:
@@ -594,7 +594,7 @@ def __init__(self, dpdk_version: str | None):
Args:
dpdk_version: The version of tested DPDK.
"""
- super(Statistics, self).__init__()
+ super().__init__()
for result in Result:
self[result.name] = 0
self["PASS RATE"] = 0.0
diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py
index 10d56eba8d..800fbef860 100644
--- a/dts/framework/testbed_model/sut_node.py
+++ b/dts/framework/testbed_model/sut_node.py
@@ -130,7 +130,7 @@ def __init__(self, node_config: SutNodeConfiguration):
Args:
node_config: The SUT node's test run configuration.
"""
- super(SutNode, self).__init__(node_config)
+ super().__init__(node_config)
self._dpdk_prefix_list = []
self._build_target_config = None
self._env_vars = {}
diff --git a/dts/framework/testbed_model/tg_node.py b/dts/framework/testbed_model/tg_node.py
index 164f790383..9dae56ed9c 100644
--- a/dts/framework/testbed_model/tg_node.py
+++ b/dts/framework/testbed_model/tg_node.py
@@ -48,7 +48,7 @@ def __init__(self, node_config: TGNodeConfiguration):
Args:
node_config: The TG node's test run configuration.
"""
- super(TGNode, self).__init__(node_config)
+ super().__init__(node_config)
self.traffic_generator = create_traffic_generator(self, node_config.traffic_generator)
self._logger.info(f"Created node: {self.name}")
@@ -90,4 +90,4 @@ def close(self) -> None:
This extends the superclass method with TG cleanup.
"""
self.traffic_generator.close()
- super(TGNode, self).close()
+ super().close()
--
2.34.1
More information about the dev
mailing list