[PATCH for-11.0 10/15] tests/functional/ppc/test_ppe42: Fix style issues reported by pylint

Thomas Huth posted 15 patches 1 day, 4 hours ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Radoslaw Biernacki <rad@semihalf.com>, Peter Maydell <peter.maydell@linaro.org>, Leif Lindholm <leif.lindholm@oss.qualcomm.com>, Eric Auger <eric.auger@redhat.com>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, Dmitry Osipenko <dmitry.osipenko@collabora.com>, "Cédric Le Goater" <clg@kaod.org>, Steven Lee <steven_lee@aspeedtech.com>, Troy Lee <leetroy@gmail.com>, Jamin Lin <jamin_lin@aspeedtech.com>, Andrew Jeffery <andrew@codeconstruct.com.au>, Joel Stanley <joel@jms.id.au>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, BALATON Zoltan <balaton@eik.bme.hu>, Glenn Miles <milesg@linux.ibm.com>, Nicholas Piggin <npiggin@gmail.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Zhao Liu <zhao1.liu@intel.com>
[PATCH for-11.0 10/15] tests/functional/ppc/test_ppe42: Fix style issues reported by pylint
Posted by Thomas Huth 1 day, 4 hours ago
From: Thomas Huth <thuth@redhat.com>

Pylint suggests to write some parts of the code in a slightly different
way ... thus rework the code to make the linter happy.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/functional/ppc/test_ppe42.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/functional/ppc/test_ppe42.py b/tests/functional/ppc/test_ppe42.py
index 26bbe11b2d3..7b360a40a54 100644
--- a/tests/functional/ppc/test_ppe42.py
+++ b/tests/functional/ppc/test_ppe42.py
@@ -6,8 +6,9 @@
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-from qemu_test import QemuSystemTest, Asset
 import asyncio
+from qemu_test import QemuSystemTest, Asset
+
 
 class Ppe42Machine(QemuSystemTest):
 
@@ -30,13 +31,13 @@ def _test_completed(self):
             raise
 
         self.log.info(output)
-        if "NIP fff80200" in output:
-            self.log.info("<test completed>")
-            return True
-        else:
+        if "NIP fff80200" not in output:
             self.log.info("<test not completed>")
             return False
 
+        self.log.info("<test completed>")
+        return True
+
     def _wait_pass_fail(self, timeout):
         while not self._test_completed():
             if timeout >= self.poll_period:
@@ -49,14 +50,13 @@ def _wait_pass_fail(self, timeout):
 
                 except asyncio.TimeoutError:
                     self.log.info("Poll period ended.")
-                    pass
 
                 except Exception as err:
                     self.log.debug(f"event_wait() failed due to {err=},"
                                     " {type(err)=}")
                     raise
 
-                if e != None:
+                if e is not None:
                     self.log.debug(f"Execution stopped: {e}")
                     self.log.debug("Exiting due to test failure")
                     self.fail("Failure detected!")
-- 
2.51.1
Re: [PATCH for-11.0 10/15] tests/functional/ppc/test_ppe42: Fix style issues reported by pylint
Posted by Philippe Mathieu-Daudé an hour ago
On 19/11/25 09:26, Thomas Huth wrote:
> From: Thomas Huth <thuth@redhat.com>
> 
> Pylint suggests to write some parts of the code in a slightly different
> way ... thus rework the code to make the linter happy.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   tests/functional/ppc/test_ppe42.py | 14 +++++++-------
>   1 file changed, 7 insertions(+), 7 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>