]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/functional/mips64el: Silence issues reported by pylint
authorThomas Huth <thuth@redhat.com>
Mon, 3 Nov 2025 19:24:30 +0000 (20:24 +0100)
committerThomas Huth <thuth@redhat.com>
Tue, 11 Nov 2025 08:35:08 +0000 (09:35 +0100)
Drop unused imports, annotate imports that are not at the top, but done
on purpose in other locations, use f-strings where it makes sense, etc.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251103192430.63278-1-thuth@redhat.com>

tests/functional/mips64el/test_malta.py
tests/functional/mips64el/test_replay.py

index e37463dc29168457d215e22a231b055161b28567..bc750cb7ad6329992bfe2dca0b2d469db2fd82c7 100755 (executable)
@@ -10,7 +10,6 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 
 import os
-import logging
 
 from qemu_test import LinuxKernelTest, Asset
 from qemu_test import exec_command_and_wait_for_pattern
@@ -50,7 +49,7 @@ class MaltaMachineConsole(LinuxKernelTest):
         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_3_19_3 = Asset(
@@ -66,7 +65,7 @@ class MaltaMachineConsole(LinuxKernelTest):
         '75ba10cd35fb44e32948eeb26974f061b703c81c4ba2fab1ebcacf1d1bec3b61')
 
     @skipUntrustedTest()
-    def test_mips64el_malta_5KEc_cpio(self):
+    def test_mips64el_malta_5kec_cpio(self):
         kernel_path = self.ASSET_KERNEL_3_19_3.fetch()
         initrd_path = self.uncompress(self.ASSET_CPIO_R1)
 
@@ -134,8 +133,8 @@ class MaltaMachineFramebuffer(LinuxKernelTest):
         Boot Linux kernel and check Tux logo is displayed on the framebuffer.
         """
 
-        import numpy as np
-        import cv2
+        import numpy as np    # pylint: disable=import-outside-toplevel
+        import cv2            # pylint: disable=import-outside-toplevel
 
         screendump_path = self.scratch_file('screendump.pbm')
 
@@ -149,7 +148,7 @@ class MaltaMachineFramebuffer(LinuxKernelTest):
                                'clocksource=GIC console=tty0 console=ttyS0')
         self.vm.add_args('-kernel', kernel_path,
                          '-cpu', 'I6400',
-                         '-smp', '%u' % cpu_cores_count,
+                         '-smp', str(cpu_cores_count),
                          '-vga', 'std',
                          '-append', kernel_command_line)
         self.vm.launch()
@@ -157,7 +156,7 @@ class MaltaMachineFramebuffer(LinuxKernelTest):
         self.wait_for_console_pattern(framebuffer_ready)
         self.vm.cmd('human-monitor-command', command_line='stop')
         res = self.vm.cmd('human-monitor-command',
-                          command_line='screendump %s' % screendump_path)
+                          command_line=f'screendump {screendump_path}')
         if 'unknown command' in res:
             self.skipTest('screendump not available')
 
@@ -191,6 +190,8 @@ class MaltaMachineFramebuffer(LinuxKernelTest):
         self.do_test_i6400_framebuffer_logo(8)
 
 
+# Add the tests from the 32-bit mipsel file here, too.
+# pylint: disable=unused-import,wrong-import-position
 from mipsel.test_malta import MaltaMachineYAMON
 
 if __name__ == '__main__':
index e9318448fa712295db4e9249dde019d4ad0572b0..9a432be5ce0d4e3f216e5d78030cbda423aa9e64 100755 (executable)
@@ -23,7 +23,7 @@ class Mips64elReplay(ReplayKernelBase):
         kernel_path = self.archive_extract(self.ASSET_KERNEL_2_63_2,
                                     member='boot/vmlinux-2.6.32-5-5kc-malta')
         kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
-        console_pattern = 'Kernel command line: %s' % kernel_command_line
+        console_pattern = f'Kernel command line: {kernel_command_line}'
         self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5)
 
 
@@ -41,7 +41,7 @@ class Mips64elReplay(ReplayKernelBase):
 
     @skipUntrustedTest()
     @skipFlakyTest("https://gitlab.com/qemu-project/qemu/-/issues/2013")
-    def test_replay_mips64el_malta_5KEc_cpio(self):
+    def test_replay_mips64el_malta_5kec_cpio(self):
         self.set_machine('malta')
         self.cpu = '5KEc'
         kernel_path = self.ASSET_KERNEL_3_19_3.fetch()