]> git.proxmox.com Git - mirror_qemu.git/commit - tests/qemu-iotests/iotests.py
qemu-iotests: fix pylint 2.8 consider-using-with error
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>
Mon, 10 May 2021 19:04:49 +0000 (21:04 +0200)
committerMax Reitz <mreitz@redhat.com>
Fri, 14 May 2021 14:14:10 +0000 (16:14 +0200)
commitac4e14f5dc93d6b4bc5d4849bb61810023330380
tree907008ea2c221072539674581b492c74a0c89266
parentbcc8584c832f7a52fd8c64483dd452c1baf01db7
qemu-iotests: fix pylint 2.8 consider-using-with error

pylint 2.8 introduces consider-using-with error, suggesting
to use the 'with' block statement when possible.

Modify all subprocess.Popen call to use the 'with' statement,
except the one in __init__ of QemuIoInteractive class, since
it is assigned to a class field and used in other methods.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20210510190449.65948-1-eesposit@redhat.com>
[mreitz: Disable bad-option-value warning in the iotests' pylintrc, so
         that disabling consider-using-with in QemuIoInteractive will
         not produce a warning in pre-2.8 pylint versions]
Signed-off-by: Max Reitz <mreitz@redhat.com>
tests/qemu-iotests/iotests.py
tests/qemu-iotests/pylintrc
tests/qemu-iotests/testrunner.py