qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tests/functional/x86_64/test_acpi_bits: Silence warnings reported by pylint
@ 2025-10-29  8:15 Thomas Huth
  2025-10-29 15:41 ` Zhao Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Huth @ 2025-10-29  8:15 UTC (permalink / raw)
  To: Ani Sinha, qemu-devel; +Cc: Michael S. Tsirkin, Paolo Bonzini, Zhao Liu

From: Thomas Huth <thuth@redhat.com>

Pylint complains about too many positional arguments for the __init__
function of the QEMUBitsMachine class, use a "*" to enforce argument
passing by names instead (which the calling sites are doing here already).

Second, use lazy logging when calling self.log.info() with a "%s" format
string, and drop a superfluous "else:" that is not necessary after a
"raise" statement.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/functional/x86_64/test_acpi_bits.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/functional/x86_64/test_acpi_bits.py b/tests/functional/x86_64/test_acpi_bits.py
index 9a2816533d6..ec716d643bf 100755
--- a/tests/functional/x86_64/test_acpi_bits.py
+++ b/tests/functional/x86_64/test_acpi_bits.py
@@ -57,6 +57,7 @@ class QEMUBitsMachine(QEMUMachine): # pylint: disable=too-few-public-methods
     """
     def __init__(self,
                  binary: str,
+                 *,
                  args: Sequence[str] = (),
                  wrapper: Sequence[str] = (),
                  name: Optional[str] = None,
@@ -225,7 +226,7 @@ def generate_bits_iso(self):
                                       stdout=subprocess.PIPE,
                                       stderr=subprocess.STDOUT,
                                       check=True)
-                self.log.info("grub-mkrescue output %s" % proc.stdout)
+                self.log.info("grub-mkrescue output %s", proc.stdout)
             else:
                 subprocess.check_call([mkrescue_script, '-o',
                                       iso_file, bits_dir],
@@ -287,9 +288,8 @@ def parse_log(self):
             except AssertionError as e:
                 self._print_log(log)
                 raise e
-            else:
-                if os.getenv('V') or os.getenv('BITS_DEBUG'):
-                    self._print_log(log)
+            if os.getenv('V') or os.getenv('BITS_DEBUG'):
+                self._print_log(log)
 
     def tearDown(self):
         """
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tests/functional/x86_64/test_acpi_bits: Silence warnings reported by pylint
  2025-10-29  8:15 [PATCH] tests/functional/x86_64/test_acpi_bits: Silence warnings reported by pylint Thomas Huth
@ 2025-10-29 15:41 ` Zhao Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Zhao Liu @ 2025-10-29 15:41 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Ani Sinha, qemu-devel, Michael S. Tsirkin, Paolo Bonzini

On Wed, Oct 29, 2025 at 09:15:14AM +0100, Thomas Huth wrote:
> Date: Wed, 29 Oct 2025 09:15:14 +0100
> From: Thomas Huth <thuth@redhat.com>
> Subject: [PATCH] tests/functional/x86_64/test_acpi_bits: Silence warnings
>  reported by pylint
> 
> From: Thomas Huth <thuth@redhat.com>
> 
> Pylint complains about too many positional arguments for the __init__
> function of the QEMUBitsMachine class, use a "*" to enforce argument
> passing by names instead (which the calling sites are doing here already).
> 
> Second, use lazy logging when calling self.log.info() with a "%s" format
> string, and drop a superfluous "else:" that is not necessary after a
> "raise" statement.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  tests/functional/x86_64/test_acpi_bits.py | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

LGTM,

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-29 15:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-29  8:15 [PATCH] tests/functional/x86_64/test_acpi_bits: Silence warnings reported by pylint Thomas Huth
2025-10-29 15:41 ` Zhao Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).