]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/functional/ppc/test_ppe42: Fix style issues reported by pylint
authorThomas Huth <thuth@redhat.com>
Wed, 19 Nov 2025 08:26:31 +0000 (09:26 +0100)
committerThomas Huth <thuth@redhat.com>
Fri, 21 Nov 2025 07:33:15 +0000 (08:33 +0100)
Pylint suggests to write some parts of the code in a slightly different
way ... thus rework the code to make the linter happy.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Glenn Miles <milesg@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251119082636.43286-11-thuth@redhat.com>

tests/functional/ppc/test_ppe42.py

index 26bbe11b2d37df81f4f032af29bbd04498b91328..7b360a40a5457fef033b0d32a157af0d15df474e 100644 (file)
@@ -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 @@ class Ppe42Machine(QemuSystemTest):
             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 @@ class Ppe42Machine(QemuSystemTest):
 
                 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!")