[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/21] iotests.py: Adjust HMP kwargs typing
From: |
John Snow |
Subject: |
[PULL 11/21] iotests.py: Adjust HMP kwargs typing |
Date: |
Tue, 20 Oct 2020 13:27:32 -0400 |
mypy wants to ensure there's consistency between the kwargs arguments
types and any unspecified keyword arguments. In this case, conv_keys is
a bool, but the remaining keys are Any type. Mypy (correctly) infers the
**kwargs type to be **Dict[str, str], which is not compatible with
conv_keys: bool.
Because QMP typing is a little fraught right now anyway, re-type kwargs
to Dict[str, Any] which has the benefit of silencing this check right
now.
A future re-design might type these more aggressively, but this will
give us a baseline to work from with minimal disruption.
(Thanks Kevin Wolf for the debugging assist here)
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 20201006235817.3280413-11-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/qemu-iotests/iotests.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index f212cec446..63d2ace93c 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -605,7 +605,7 @@ def add_incoming(self, addr):
def hmp(self, command_line: str, use_log: bool = False) -> QMPMessage:
cmd = 'human-monitor-command'
- kwargs = {'command-line': command_line}
+ kwargs: Dict[str, Any] = {'command-line': command_line}
if use_log:
return self.qmp_log(cmd, **kwargs)
else:
--
2.26.2
- [PULL 01/21] MAINTAINERS: Add Python library stanza, (continued)
- [PULL 01/21] MAINTAINERS: Add Python library stanza, John Snow, 2020/10/20
- [PULL 02/21] python/qemu: use isort to lay out imports, John Snow, 2020/10/20
- [PULL 03/21] python/machine.py: Fix monitor address typing, John Snow, 2020/10/20
- [PULL 04/21] python/machine.py: reorder __init__, John Snow, 2020/10/20
- [PULL 05/21] python/machine.py: Don't modify state in _base_args(), John Snow, 2020/10/20
- [PULL 07/21] python/machine.py: use qmp.command, John Snow, 2020/10/20
- [PULL 08/21] python/machine.py: Add _qmp access shim, John Snow, 2020/10/20
- [PULL 06/21] python/machine.py: Handle None events in events_wait, John Snow, 2020/10/20
- [PULL 10/21] python/qemu: make 'args' style arguments immutable, John Snow, 2020/10/20
- [PULL 09/21] python/machine.py: fix _popen access, John Snow, 2020/10/20
- [PULL 11/21] iotests.py: Adjust HMP kwargs typing,
John Snow <=
- [PULL 14/21] python/qemu/console_socket.py: fix typing of settimeout, John Snow, 2020/10/20
- [PULL 13/21] python/qemu/console_socket.py: Correct type of recv(), John Snow, 2020/10/20
- [PULL 15/21] python/qemu/console_socket.py: Clarify type of drain_thread, John Snow, 2020/10/20
- [PULL 19/21] python: add mypy config, John Snow, 2020/10/20
- [PULL 12/21] python/qemu: Add mypy type annotations, John Snow, 2020/10/20
- [PULL 20/21] python/qemu/qmp.py: re-raise OSError when encountered, John Snow, 2020/10/20
- [PULL 21/21] python/qemu/qmp.py: Fix settimeout operation, John Snow, 2020/10/20
- [PULL 17/21] python/qemu/console_socket.py: avoid encoding to/from string, John Snow, 2020/10/20