Skip to contentSkip to conversation

tests/functional/x86_64/test_virtio_balloon: Fix cosmetic issues from pylint

PATCH In review Thomas Huth 3 participants 3 messages Oct 29, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/functional/x86_64/test_virtio_balloon: Fix cosmetic issues from pylint

From: Thomas Huth <[email protected]>

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.

---
 tests/functional/x86_64/test_virtio_balloon.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
tests/functional/x86_64/test_virtio_balloon.py +4 -4
index 5877b6c408c..7a579e0d69a 100755
@@ -66,7 +66,7 @@ def assert_initial_stats(self):
         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 @@ def assert_running_stats(self, then):
 
         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 @@ def assert_running_stats(self, then):
             "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
Signature · 1 line
2.51.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Thomas Huth

From: Thomas Huth <[email protected]>

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.

---

Quoted 42 lines
 tests/functional/x86_64/test_virtio_balloon.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
tests/functional/x86_64/test_virtio_balloon.py +4 -5
index 5877b6c408c..7a579e0d69a 100755
@@ -66,7 +66,7 @@ def assert_initial_stats(self):
         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 @@ def assert_running_stats(self, then):
 
         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 @@ def assert_running_stats(self, then):
             "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
--

2.51.0

Reviewed-by on v1 1/1
#2 lore raw
In reply to Thomas Huth
Quoted 12 lines · Thomas Huth

Date: Wed, 29 Oct 2025 08:53:42 +0100
From: Thomas Huth <[email protected]>
Subject: [PATCH] tests/functional/x86_64/test_virtio_balloon: Fix cosmetic
issues from pylint

From: Thomas Huth <[email protected]>

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.

Quoted 4 lines
---
 tests/functional/x86_64/test_virtio_balloon.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

LGTM,