[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/10] iotests: silence spurious consider-using-with warnings
From: |
John Snow |
Subject: |
[PATCH 09/10] iotests: silence spurious consider-using-with warnings |
Date: |
Wed, 12 May 2021 17:46:41 -0400 |
In a few cases, we can't use 'with ...' because they belong to
long-running classes that need those items to stay open at the end of
the block. We're handling it, so tell pylint to shush.
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/qemu-iotests/iotests.py | 2 +-
tests/qemu-iotests/testrunner.py | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 5d5ec40429b..e09c991b84e 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -311,7 +311,7 @@ def qemu_nbd_popen(*args):
cmd.extend(args)
log('Start NBD server')
- p = subprocess.Popen(cmd)
+ p = subprocess.Popen(cmd) # pylint: disable=consider-using-with
try:
while not os.path.exists(pid_file):
if p.poll() is not None:
diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunner.py
index 1fc61fcaa34..34fb551c01b 100644
--- a/tests/qemu-iotests/testrunner.py
+++ b/tests/qemu-iotests/testrunner.py
@@ -258,6 +258,7 @@ def do_run_test(self, test: str) -> TestResult:
t0 = time.time()
with f_bad.open('w', encoding="utf-8") as f:
+ # pylint: disable=consider-using-with
proc = subprocess.Popen(args, cwd=str(f_test.parent), env=env,
stdout=f, stderr=subprocess.STDOUT)
try:
--
2.30.2
- [PATCH 01/10] python/console_socket: avoid one-letter variable, (continued)
- [PATCH 01/10] python/console_socket: avoid one-letter variable, John Snow, 2021/05/12
- [PATCH 03/10] python/machine: use subprocess.run instead of subprocess.Popen, John Snow, 2021/05/12
- [PATCH 04/10] python/console_socket: Add a pylint ignore, John Snow, 2021/05/12
- [PATCH 08/10] iotests: use 'with open()' where applicable, John Snow, 2021/05/12
- [PATCH 06/10] python/machine: disable warning for Popen in _launch(), John Snow, 2021/05/12
- [PATCH 09/10] iotests: silence spurious consider-using-with warnings,
John Snow <=
- [PATCH 07/10] iotests: use subprocess.run where possible, John Snow, 2021/05/12
- [PATCH 02/10] python/machine: use subprocess.DEVNULL instead of open(os.path.devnull), John Snow, 2021/05/12
- [PATCH 10/10] iotests: ensure that QemuIoInteractive definitely closes, John Snow, 2021/05/12
- [PATCH 05/10] python/machine: Disable pylint warning for open() in _pre_launch, John Snow, 2021/05/12
- Re: [PATCH 00/10] Python: delint iotests, machine.py and console_socket.py, John Snow, 2021/05/17