DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Juraj Linkeš" <juraj.linkes@pantheon.tech>
To: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com,
	jspewock@iol.unh.edu, probb@iol.unh.edu, paul.szczepanek@arm.com,
	Luca.Vizzarro@arm.com, npratte@iol.unh.edu
Cc: dev@dpdk.org, "Juraj Linkeš" <juraj.linkes@pantheon.tech>
Subject: [PATCH v1 3/4] dts: unify super calls
Date: Tue, 23 Apr 2024 11:12:51 +0200	[thread overview]
Message-ID: <20240423091252.62924-4-juraj.linkes@pantheon.tech> (raw)
In-Reply-To: <20240423091252.62924-1-juraj.linkes@pantheon.tech>

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@pantheon.tech>
---
 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 83e637c280..0163893adf 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, execution: ExecutionConfiguration):
         Args:
             execution: The execution's test run configuration.
         """
-        super(ExecutionResult, self).__init__()
+        super().__init__()
         self._config = execution
         self._test_suites_with_cases = []
 
@@ -430,7 +430,7 @@ def __init__(
             test_suites_with_cases: The test suites with test cases to be run in this build target.
             build_target: The build target's test run configuration.
         """
-        super(BuildTargetResult, self).__init__()
+        super().__init__()
         self.arch = build_target.arch
         self.os = build_target.os
         self.cpu = build_target.cpu
@@ -491,7 +491,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
 
@@ -534,7 +534,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:
@@ -592,7 +592,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 d3206e87e0..b0126e5e3d 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


  parent reply	other threads:[~2024-04-23  9:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23  9:12 [PATCH v1 0/4] node and inheritance improvements Juraj Linkeš
2024-04-23  9:12 ` [PATCH v1 1/4] dts: add tg node execution setup and teardown Juraj Linkeš
2024-04-23  9:18   ` Luca Vizzarro
2024-04-30 16:15     ` Jeremy Spewock
2024-04-23  9:12 ` [PATCH v1 2/4] dts: unify class inheritance from object Juraj Linkeš
2024-04-23  9:19   ` Luca Vizzarro
2024-04-23 14:53   ` Patrick Robb
2024-04-30 16:15     ` Jeremy Spewock
2024-04-23  9:12 ` Juraj Linkeš [this message]
2024-04-23 10:06   ` [PATCH v1 3/4] dts: unify super calls Luca Vizzarro
2024-04-23 14:57   ` Patrick Robb
2024-04-30 16:15     ` Jeremy Spewock
2024-04-23  9:12 ` [PATCH v1 4/4] dts: refine pre-test setup and teardown steps Juraj Linkeš
2024-04-23  9:19   ` Luca Vizzarro
2024-04-30 16:15     ` Jeremy Spewock
2024-04-23 10:07 ` [PATCH v1 0/4] node and inheritance improvements Luca Vizzarro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240423091252.62924-4-juraj.linkes@pantheon.tech \
    --to=juraj.linkes@pantheon.tech \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Luca.Vizzarro@arm.com \
    --cc=dev@dpdk.org \
    --cc=jspewock@iol.unh.edu \
    --cc=npratte@iol.unh.edu \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).