From 757dbafe115e4f33782ac59812f37997f5b5ce6c Mon Sep 17 00:00:00 2001 From: John Snow Date: Fri, 1 Nov 2024 13:36:57 -0400 Subject: iotests: reflow ReproducibleTestRunner arguments Trivial reflow to let the type names breathe. (I need to add a longer type name.) Signed-off-by: John Snow Message-ID: <20241101173700.965776-2-jsnow@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/iotests.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index ea48af4..673bbcd 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -1614,10 +1614,13 @@ class ReproducibleStreamWrapper: self.stream.write(arg) class ReproducibleTestRunner(unittest.TextTestRunner): - def __init__(self, stream: Optional[TextIO] = None, - resultclass: Type[unittest.TestResult] = - ReproducibleTestResult, - **kwargs: Any) -> None: + def __init__( + self, + stream: Optional[TextIO] = None, + resultclass: Type[unittest.TestResult] = + ReproducibleTestResult, + **kwargs: Any + ) -> None: rstream = ReproducibleStreamWrapper(stream or sys.stdout) super().__init__(stream=rstream, # type: ignore descriptions=True, -- cgit v1.1 From d808888429dbdd308e7348cb112ece06d287b87a Mon Sep 17 00:00:00 2001 From: John Snow Date: Fri, 1 Nov 2024 13:36:58 -0400 Subject: iotests: correct resultclass type in ReproducibleTestRunner I have a vague memory that I suggested this base class to Vladimir and said "Maybe someday it will break, and I'll just fix it then." Guess that's today. Fixes various mypy errors in the "make check-tox" python test for at least Python3.8; seemingly requires a fairly modern mypy and/or Python base version to trigger. Signed-off-by: John Snow Message-ID: <20241101173700.965776-3-jsnow@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/iotests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 673bbcd..19817c7 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -1617,7 +1617,7 @@ class ReproducibleTestRunner(unittest.TextTestRunner): def __init__( self, stream: Optional[TextIO] = None, - resultclass: Type[unittest.TestResult] = + resultclass: Type[unittest.TextTestResult] = ReproducibleTestResult, **kwargs: Any ) -> None: -- cgit v1.1 From 4c600fdcd49c5661b658c325100dcd7754b0a479 Mon Sep 17 00:00:00 2001 From: John Snow Date: Fri, 1 Nov 2024 13:36:59 -0400 Subject: python: disable too-many-positional-arguments warning Newest versions of pylint complain about specifically positional arguments in addition to too many in general. We already disable the general case, so silence this new warning too. Signed-off-by: John Snow Message-ID: <20241101173700.965776-4-jsnow@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/pylintrc | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/qemu-iotests/pylintrc b/tests/qemu-iotests/pylintrc index 05b75ee..c5f4833 100644 --- a/tests/qemu-iotests/pylintrc +++ b/tests/qemu-iotests/pylintrc @@ -13,6 +13,7 @@ disable=invalid-name, no-else-return, too-few-public-methods, too-many-arguments, + too-many-positional-arguments, too-many-branches, too-many-lines, too-many-locals, -- cgit v1.1 From 770de685353e8c495ad4773fbd4bc0db997e4dfd Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 22 Nov 2024 23:40:42 +0100 Subject: tests/avocado/hotplug_blk: Fix addr in device_add command pci_devfn properties accept both integer and string values, but integer 1 and string '1' have different meanings: The integer value means device 0, function 1 whereas the string value '1' is short for '1.0' and means device 1, function 0. This test wants the string version so that the device actually becomes visible for the guest. device_add hides the problem because it goes through QemuOpts, which turns all properties into strings - this is a QEMU bug that we want to fix, but that cancelled out the bug in this test. Fix the test first so that device_add can be fixed afterwards. Signed-off-by: Kevin Wolf Message-ID: <20241122224042.149258-1-kwolf@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Kevin Wolf --- tests/avocado/hotplug_blk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/avocado/hotplug_blk.py b/tests/avocado/hotplug_blk.py index d55ded1..b36bca0 100644 --- a/tests/avocado/hotplug_blk.py +++ b/tests/avocado/hotplug_blk.py @@ -33,7 +33,7 @@ class HotPlug(LinuxTest): 'drive': 'disk', 'id': 'virtio-disk0', 'bus': 'pci.1', - 'addr': 1 + 'addr': '1', } self.assert_no_vda() -- cgit v1.1