From: John Snow <jsnow@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
John Snow <jsnow@redhat.com>,
qemu-block@nongnu.org
Subject: [PATCH 6/6] iotests: Update for pylint 2.11.1
Date: Wed, 22 Sep 2021 20:16:25 -0400 [thread overview]
Message-ID: <20210923001625.3996451-7-jsnow@redhat.com> (raw)
In-Reply-To: <20210923001625.3996451-1-jsnow@redhat.com>
1. Ignore the new f-strings warning, we're not interested in doing a
full conversion at this time.
2. Just mute the unbalanced-tuple-unpacking warning, it's not a real
error in this case and muting the dozens of callsites is just not
worth it.
3. Add encodings to read_text().
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/qemu-iotests/pylintrc | 6 +++++-
tests/qemu-iotests/testrunner.py | 7 ++++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/tests/qemu-iotests/pylintrc b/tests/qemu-iotests/pylintrc
index f2c0b522ac0..8cb4e1d6a6d 100644
--- a/tests/qemu-iotests/pylintrc
+++ b/tests/qemu-iotests/pylintrc
@@ -19,13 +19,17 @@ disable=invalid-name,
too-many-public-methods,
# pylint warns about Optional[] etc. as unsubscriptable in 3.9
unsubscriptable-object,
+ # pylint's static analysis causes false positivies for file_path();
+ # If we really care to make it statically knowable, we'll use mypy.
+ unbalanced-tuple-unpacking,
# Sometimes we need to disable a newly introduced pylint warning.
# Doing so should not produce a warning in older versions of pylint.
bad-option-value,
# These are temporary, and should be removed:
missing-docstring,
too-many-return-statements,
- too-many-statements
+ too-many-statements,
+ consider-using-f-string,
[FORMAT]
diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunner.py
index 4a6ec421ed6..a56b6da3968 100644
--- a/tests/qemu-iotests/testrunner.py
+++ b/tests/qemu-iotests/testrunner.py
@@ -266,12 +266,13 @@ def do_run_test(self, test: str) -> TestResult:
diff=file_diff(str(f_reference), str(f_bad)))
if f_notrun.exists():
- return TestResult(status='not run',
- description=f_notrun.read_text().strip())
+ return TestResult(
+ status='not run',
+ description=f_notrun.read_text(encoding='utf-8').strip())
casenotrun = ''
if f_casenotrun.exists():
- casenotrun = f_casenotrun.read_text()
+ casenotrun = f_casenotrun.read_text(encoding='utf-8')
diff = file_diff(str(f_reference), str(f_bad))
if diff:
--
2.31.1
next prev parent reply other threads:[~2021-09-23 0:23 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-23 0:16 [PATCH 0/6] iotests: update environment and linting configuration John Snow
2021-09-23 0:16 ` [PATCH 1/6] iotests: add 'qemu' package location to PYTHONPATH in testenv John Snow
2021-09-23 10:33 ` Philippe Mathieu-Daudé
2021-09-23 15:19 ` Vladimir Sementsov-Ogievskiy
2021-09-23 15:46 ` John Snow
2021-09-23 0:16 ` [PATCH 2/6] iotests: add warning for rogue 'qemu' packages John Snow
2021-09-23 10:57 ` Kevin Wolf
2021-09-23 11:17 ` Kevin Wolf
2021-09-23 14:59 ` John Snow
2021-09-23 11:09 ` Daniel P. Berrangé
2021-09-23 15:42 ` John Snow
2021-09-23 0:16 ` [PATCH 3/6] iotests/linters: check mypy files all at once John Snow
2021-09-23 10:33 ` Philippe Mathieu-Daudé
2021-09-23 15:39 ` Vladimir Sementsov-Ogievskiy
2021-09-23 0:16 ` [PATCH 4/6] iotests/mirror-top-perms: Adjust imports John Snow
2021-09-23 15:40 ` Vladimir Sementsov-Ogievskiy
2021-09-23 0:16 ` [PATCH 5/6] iotests/migrate-bitmaps-test: delint John Snow
2021-09-23 15:48 ` Vladimir Sementsov-Ogievskiy
2021-09-23 0:16 ` John Snow [this message]
2021-09-23 15:51 ` [PATCH 6/6] iotests: Update for pylint 2.11.1 Vladimir Sementsov-Ogievskiy
2021-09-23 12:57 ` [PATCH 0/6] iotests: update environment and linting configuration Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210923001625.3996451-7-jsnow@redhat.com \
--to=jsnow@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).