[PATCH 02/22] tests/functional: remove unused system imports

Daniel P. Berrangé posted 22 patches 1 year, 1 month ago
There is a newer version of this series
[PATCH 02/22] tests/functional: remove unused system imports
Posted by Daniel P. Berrangé 1 year, 1 month ago
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/functional/test_aarch64_sbsaref.py       | 1 -
 tests/functional/test_acpi_bits.py             | 1 -
 tests/functional/test_m68k_mcf5208evb.py       | 2 --
 tests/functional/test_microblaze_s3adsp1800.py | 1 -
 tests/functional/test_mips64el_loongson3v.py   | 1 -
 tests/functional/test_or1k_sim.py              | 2 --
 tests/functional/test_s390x_topology.py        | 1 -
 tests/functional/test_sh4_tuxrun.py            | 4 ----
 tests/functional/test_sh4eb_r2d.py             | 1 -
 tests/functional/test_virtio_version.py        | 2 --
 10 files changed, 16 deletions(-)

diff --git a/tests/functional/test_aarch64_sbsaref.py b/tests/functional/test_aarch64_sbsaref.py
index 9fda396b3a..6db08da522 100755
--- a/tests/functional/test_aarch64_sbsaref.py
+++ b/tests/functional/test_aarch64_sbsaref.py
@@ -14,7 +14,6 @@
 from qemu_test import wait_for_console_pattern
 from qemu_test import interrupt_interactive_console_until_pattern
 from qemu_test.utils import lzma_uncompress
-from unittest import skipUnless
 
 def fetch_firmware(test):
     """
diff --git a/tests/functional/test_acpi_bits.py b/tests/functional/test_acpi_bits.py
index 3498b96787..6fc49a30bc 100755
--- a/tests/functional/test_acpi_bits.py
+++ b/tests/functional/test_acpi_bits.py
@@ -39,7 +39,6 @@
 import subprocess
 import tarfile
 import tempfile
-import time
 import zipfile
 
 from pathlib import Path
diff --git a/tests/functional/test_m68k_mcf5208evb.py b/tests/functional/test_m68k_mcf5208evb.py
index 00c59590c3..fb178fde1c 100755
--- a/tests/functional/test_m68k_mcf5208evb.py
+++ b/tests/functional/test_m68k_mcf5208evb.py
@@ -5,8 +5,6 @@
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-import os
-
 from qemu_test import LinuxKernelTest, Asset
 from qemu_test.utils import archive_extract
 
diff --git a/tests/functional/test_microblaze_s3adsp1800.py b/tests/functional/test_microblaze_s3adsp1800.py
index 4f692ffdb1..d2be3105a2 100755
--- a/tests/functional/test_microblaze_s3adsp1800.py
+++ b/tests/functional/test_microblaze_s3adsp1800.py
@@ -7,7 +7,6 @@
 # This work is licensed under the terms of the GNU GPL, version 2 or
 # later. See the COPYING file in the top-level directory.
 
-import time
 from qemu_test import exec_command, exec_command_and_wait_for_pattern
 from qemu_test import QemuSystemTest, Asset
 from qemu_test import wait_for_console_pattern
diff --git a/tests/functional/test_mips64el_loongson3v.py b/tests/functional/test_mips64el_loongson3v.py
index 55d62928c7..e57ec5499e 100755
--- a/tests/functional/test_mips64el_loongson3v.py
+++ b/tests/functional/test_mips64el_loongson3v.py
@@ -10,7 +10,6 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 
 import os
-import time
 
 from unittest import skipUnless
 from qemu_test import QemuSystemTest, Asset
diff --git a/tests/functional/test_or1k_sim.py b/tests/functional/test_or1k_sim.py
index 10e0437c50..5b68b6b628 100755
--- a/tests/functional/test_or1k_sim.py
+++ b/tests/functional/test_or1k_sim.py
@@ -5,8 +5,6 @@
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-import os
-
 from qemu_test import LinuxKernelTest, Asset
 from qemu_test.utils import archive_extract
 
diff --git a/tests/functional/test_s390x_topology.py b/tests/functional/test_s390x_topology.py
index 20727f6bdf..c54c7a8177 100755
--- a/tests/functional/test_s390x_topology.py
+++ b/tests/functional/test_s390x_topology.py
@@ -11,7 +11,6 @@
 # later.  See the COPYING file in the top-level directory.
 
 import os
-import time
 
 from qemu_test import QemuSystemTest, Asset
 from qemu_test import exec_command
diff --git a/tests/functional/test_sh4_tuxrun.py b/tests/functional/test_sh4_tuxrun.py
index b33533fc7e..1748f8c7ef 100755
--- a/tests/functional/test_sh4_tuxrun.py
+++ b/tests/functional/test_sh4_tuxrun.py
@@ -11,10 +11,6 @@
 #
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-import os
-import time
-
-from unittest import skipUnless
 from qemu_test import Asset, exec_command_and_wait_for_pattern
 from qemu_test.tuxruntest import TuxRunBaselineTest
 
diff --git a/tests/functional/test_sh4eb_r2d.py b/tests/functional/test_sh4eb_r2d.py
index d9c022c8b8..cd46007942 100755
--- a/tests/functional/test_sh4eb_r2d.py
+++ b/tests/functional/test_sh4eb_r2d.py
@@ -10,7 +10,6 @@
 from qemu_test import LinuxKernelTest, Asset
 from qemu_test import exec_command_and_wait_for_pattern
 from qemu_test.utils import archive_extract
-from unittest import skipUnless
 
 class R2dEBTest(LinuxKernelTest):
 
diff --git a/tests/functional/test_virtio_version.py b/tests/functional/test_virtio_version.py
index eb23060564..501e0e5397 100755
--- a/tests/functional/test_virtio_version.py
+++ b/tests/functional/test_virtio_version.py
@@ -9,8 +9,6 @@
 #
 # This work is licensed under the terms of the GNU GPL, version 2 or
 # later.  See the COPYING file in the top-level directory.
-import sys
-import os
 
 from qemu.machine import QEMUMachine
 from qemu_test import QemuSystemTest
-- 
2.46.0


Re: [PATCH 02/22] tests/functional: remove unused system imports
Posted by Thomas Huth 1 year, 1 month ago
On 29/11/2024 18.31, Daniel P. Berrangé wrote:
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   tests/functional/test_aarch64_sbsaref.py       | 1 -
>   tests/functional/test_acpi_bits.py             | 1 -
>   tests/functional/test_m68k_mcf5208evb.py       | 2 --
>   tests/functional/test_microblaze_s3adsp1800.py | 1 -
>   tests/functional/test_mips64el_loongson3v.py   | 1 -
>   tests/functional/test_or1k_sim.py              | 2 --
>   tests/functional/test_s390x_topology.py        | 1 -
>   tests/functional/test_sh4_tuxrun.py            | 4 ----
>   tests/functional/test_sh4eb_r2d.py             | 1 -
>   tests/functional/test_virtio_version.py        | 2 --
>   10 files changed, 16 deletions(-)

Out of curiosity: Is there a way to check for this with a program, or did 
you check it manually?

Reviewed-by: Thomas Huth <thuth@redhat.com>


Re: [PATCH 02/22] tests/functional: remove unused system imports
Posted by Daniel P. Berrangé 1 year, 1 month ago
On Sat, Nov 30, 2024 at 10:59:55AM +0100, Thomas Huth wrote:
> On 29/11/2024 18.31, Daniel P. Berrangé wrote:
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> >   tests/functional/test_aarch64_sbsaref.py       | 1 -
> >   tests/functional/test_acpi_bits.py             | 1 -
> >   tests/functional/test_m68k_mcf5208evb.py       | 2 --
> >   tests/functional/test_microblaze_s3adsp1800.py | 1 -
> >   tests/functional/test_mips64el_loongson3v.py   | 1 -
> >   tests/functional/test_or1k_sim.py              | 2 --
> >   tests/functional/test_s390x_topology.py        | 1 -
> >   tests/functional/test_sh4_tuxrun.py            | 4 ----
> >   tests/functional/test_sh4eb_r2d.py             | 1 -
> >   tests/functional/test_virtio_version.py        | 2 --
> >   10 files changed, 16 deletions(-)
> 
> Out of curiosity: Is there a way to check for this with a program, or did
> you check it manually?

IIRC, pylint can check this sort of thing, but I performed a horror show
with grep, sed and awk.

We really ought to get black, pylint, flake8, integrated into meson.build,
so we can add checks to python code around the tree more easily.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|