]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/functional/x86_64/test_virtio_balloon: Fix cosmetic issues from pylint
authorThomas Huth <thuth@redhat.com>
Wed, 29 Oct 2025 07:53:42 +0000 (08:53 +0100)
committerThomas Huth <thuth@redhat.com>
Mon, 3 Nov 2025 07:27:59 +0000 (08:27 +0100)
Pylint complains about some style issues in this file: Unused variables
should be marked with an underscore, "when > then and when < now"
can be simplified to "now > when > then" and expectData doesn't conform
to the usual snake_case naming style.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251029075342.47335-1-thuth@redhat.com>

tests/functional/x86_64/test_virtio_balloon.py

index 5877b6c408ca886b0b3db9b7251e6278d91b257f..7a579e0d69aa70d8998ef3f5025dac945e9b339a 100755 (executable)
@@ -66,7 +66,7 @@ class VirtioBalloonx86(QemuSystemTest):
         when = ret.get('last-update')
         assert when == 0
         stats = ret.get('stats')
-        for name, val in stats.items():
+        for _name, val in stats.items():
             assert val == UNSET_STATS_VALUE
 
     def assert_running_stats(self, then):
@@ -87,10 +87,10 @@ class VirtioBalloonx86(QemuSystemTest):
 
         now = time.time()
 
-        assert when > then and when < now
+        assert now > when > then
         stats = ret.get('stats')
         # Stat we expect this particular Kernel to have set
-        expectData = [
+        expect_data = [
             "stat-available-memory",
             "stat-disk-caches",
             "stat-free-memory",
@@ -103,7 +103,7 @@ class VirtioBalloonx86(QemuSystemTest):
             "stat-total-memory",
         ]
         for name, val in stats.items():
-            if name in expectData:
+            if name in expect_data:
                 assert val != UNSET_STATS_VALUE
             else:
                 assert val == UNSET_STATS_VALUE