summary refs log tree commit diff stats
path: root/tests/qemu-iotests/iotests.py
diff options
context:
space:
mode:
authorHanna Reitz <hreitz@redhat.com>2021-08-24 17:35:40 +0200
committerHanna Reitz <hreitz@redhat.com>2021-09-15 15:54:07 +0200
commitcc16153f1fdec4bc841f0bcb9317c4639ab42530 (patch)
tree660746a0a936ec38ccd5d83c6dd69effc1817616 /tests/qemu-iotests/iotests.py
parent81dcb9ca1ff7f5588ed94824f13bc4c5232aca95 (diff)
downloadfocaccia-qemu-cc16153f1fdec4bc841f0bcb9317c4639ab42530.tar.gz
focaccia-qemu-cc16153f1fdec4bc841f0bcb9317c4639ab42530.zip
iotests: Fix use-{list,dict}-literal warnings
pylint proposes using `[]` instead of `list()` and `{}` instead of
`dict()`, because it is faster.  That seems simple enough, so heed its
advice.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20210824153540.177128-3-hreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Diffstat (limited to 'tests/qemu-iotests/iotests.py')
-rw-r--r--tests/qemu-iotests/iotests.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index d8c64d4c11..ce06cf5630 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -703,7 +703,7 @@ class VM(qtest.QEMUQtestMachine):
 
     def flatten_qmp_object(self, obj, output=None, basestr=''):
         if output is None:
-            output = dict()
+            output = {}
         if isinstance(obj, list):
             for i, item in enumerate(obj):
                 self.flatten_qmp_object(item, output, basestr + str(i) + '.')
@@ -716,7 +716,7 @@ class VM(qtest.QEMUQtestMachine):
 
     def qmp_to_opts(self, obj):
         obj = self.flatten_qmp_object(obj)
-        output_list = list()
+        output_list = []
         for key in obj:
             output_list += [key + '=' + obj[key]]
         return ','.join(output_list)