[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/25] Python/iotests: Add type hint for nbd module
From: |
John Snow |
Subject: |
[PULL 07/25] Python/iotests: Add type hint for nbd module |
Date: |
Fri, 13 Oct 2023 15:09:22 -0400 |
The test bails gracefully if this module isn't installed, but linters
need a little help understanding that. It's enough to just declare the
type in this case.
(Fixes pylint complaining about use of an uninitialized variable because
it isn't wise enough to understand the notrun call is noreturn.)
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-id: 20231006195243.3131140-2-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/qemu-iotests/tests/nbd-multiconn | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/tests/nbd-multiconn
b/tests/qemu-iotests/tests/nbd-multiconn
index 478a1eaba2..7e686a786e 100755
--- a/tests/qemu-iotests/tests/nbd-multiconn
+++ b/tests/qemu-iotests/tests/nbd-multiconn
@@ -20,6 +20,8 @@
import os
from contextlib import contextmanager
+from types import ModuleType
+
import iotests
from iotests import qemu_img_create, qemu_io
@@ -28,7 +30,7 @@ disk = os.path.join(iotests.test_dir, 'disk')
size = '4M'
nbd_sock = os.path.join(iotests.sock_dir, 'nbd_sock')
nbd_uri = 'nbd+unix:///{}?socket=' + nbd_sock
-
+nbd: ModuleType
@contextmanager
def open_nbd(export_name):
--
2.41.0
- [PULL 00/25] Python patches, John Snow, 2023/10/13
- [PULL 08/25] python/qmp: remove Server.wait_closed() call for Python 3.12, John Snow, 2023/10/13
- [PULL 03/25] python/console_socket: accept existing FD in initializer, John Snow, 2023/10/13
- [PULL 02/25] python/machine: close sock_pair in cleanup path, John Snow, 2023/10/13
- [PULL 04/25] python/machine: use socketpair() for console connections, John Snow, 2023/10/13
- [PULL 09/25] configure: fix error message to say Python 3.8, John Snow, 2023/10/13
- [PULL 11/25] python/qemu/qmp/legacy: cmd(): drop cmd_id unused argument, John Snow, 2023/10/13
- [PULL 05/25] python/machine: use socketpair() for qtest connection, John Snow, 2023/10/13
- [PULL 07/25] Python/iotests: Add type hint for nbd module,
John Snow <=
- [PULL 06/25] python/machine: remove unused sock_dir argument, John Snow, 2023/10/13
- [PULL 10/25] Python: Enable python3.12 support, John Snow, 2023/10/13
- [PULL 01/25] python/machine: move socket setup out of _base_args property, John Snow, 2023/10/13
- [PULL 12/25] qmp_shell.py: _fill_completion() use .command() instead of .cmd(), John Snow, 2023/10/13
- [PULL 14/25] python: rename QEMUMonitorProtocol.cmd() to cmd_raw(), John Snow, 2023/10/13
- [PULL 16/25] python/machine.py: upgrade vm.cmd() method, John Snow, 2023/10/13
- [PULL 13/25] scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd(), John Snow, 2023/10/13
- [PULL 22/25] iotests.py: pause_job(): drop return value, John Snow, 2023/10/13
- [PULL 17/25] iotests: QemuStorageDaemon: add cmd() method like in QEMUMachine., John Snow, 2023/10/13
- [PULL 18/25] iotests: add some missed checks of qmp result, John Snow, 2023/10/13