]> git.proxmox.com Git - mirror_qemu.git/commitdiff
iotests.py: Adjust HMP kwargs typing
authorJohn Snow <jsnow@redhat.com>
Tue, 6 Oct 2020 23:58:07 +0000 (19:58 -0400)
committerJohn Snow <jsnow@redhat.com>
Tue, 20 Oct 2020 13:37:57 +0000 (09:37 -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

index f212cec446d40b58b5d84280d59259b0b6c47485..63d2ace93c028b95ceca1cec3eab01ff250d7e84 100644 (file)
@@ -605,7 +605,7 @@ class VM(qtest.QEMUQtestMachine):
 
     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: