[PULL 02/15] tests/functional/mips/test_malta: Silence warnings reported by pylint

Thomas Huth posted 15 patches 3 weeks, 6 days ago
Maintainers: John Snow <jsnow@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Mauro Carvalho Chehab <mchehab+huawei@kernel.org>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Ilya Leoshkevich <iii@linux.ibm.com>, David Hildenbrand <david@kernel.org>, Farhan Ali <alifm@linux.ibm.com>, Paolo Bonzini <pbonzini@redhat.com>, Eric Auger <eric.auger@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, Dmitry Osipenko <dmitry.osipenko@collabora.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, "Daniel P. Berrangé" <berrange@redhat.com>, Aurelien Jarno <aurelien@aurel32.net>, Nicholas Piggin <npiggin@gmail.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>
[PULL 02/15] tests/functional/mips/test_malta: Silence warnings reported by pylint
Posted by Thomas Huth 3 weeks, 6 days ago
From: Thomas Huth <thuth@redhat.com>

Pylint complains about too many positional arguments for the
mips_check_wheezy() function. Add a "*" to enforce that the later
ones are passed with an argument name (all calling sites are doing
this already).

Also turn some old-school format strings into proper f-strings now.

Message-Id: <20251119082636.43286-6-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/functional/mips/test_malta.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/functional/mips/test_malta.py b/tests/functional/mips/test_malta.py
index 7a734bc069b..e8f49f130be 100755
--- a/tests/functional/mips/test_malta.py
+++ b/tests/functional/mips/test_malta.py
@@ -50,7 +50,7 @@ def mips_run_common_commands(test, prompt='#'):
         ' : ata_piix')
     wait_for_console_pattern(test, prompt)
 
-def mips_check_wheezy(test, kernel_path, image_path, kernel_command_line,
+def mips_check_wheezy(test, kernel_path, image_path, kernel_command_line, *,
                       dl_file, hsum, nic='pcnet', cpuinfo='MIPS 24Kc'):
     test.require_netdev('user')
     test.require_device(nic)
@@ -59,10 +59,10 @@ def mips_check_wheezy(test, kernel_path, image_path, kernel_command_line,
     port=8080
     test.vm.add_args('-kernel', kernel_path,
                      '-append', kernel_command_line,
-                     '-drive', 'file=%s,snapshot=on' % image_path,
+                     '-drive', f'file={image_path},snapshot=on',
                      '-netdev', 'user,id=n1' +
                                 ',tftp=' + os.path.basename(kernel_path) +
-                                ',hostfwd=tcp:127.0.0.1:0-:%d' % port,
+                                f',hostfwd=tcp:127.0.0.1:0-:{port}',
                      '-device', f'{nic},netdev=n1',
                      '-no-reboot')
     test.vm.set_console()
@@ -111,7 +111,7 @@ def test_mips_malta(self):
         self.vm.add_args('-kernel', kernel_path,
                          '-append', kernel_command_line)
         self.vm.launch()
-        console_pattern = 'Kernel command line: %s' % kernel_command_line
+        console_pattern = f'Kernel command line: {kernel_command_line}'
         self.wait_for_console_pattern(console_pattern)
 
     ASSET_KERNEL_4_5_0 = Asset(
-- 
2.52.0