Skip to content

Commit 3765315

Browse files
jnsnowkevmw
authored andcommitted
iotests: Update for pylint 2.11.1
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 <[email protected]> Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]> Reviewed-by: Kevin Wolf <[email protected]> Message-Id: <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
1 parent 2296899 commit 3765315

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

tests/qemu-iotests/pylintrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,17 @@ disable=invalid-name,
1919
too-many-public-methods,
2020
# pylint warns about Optional[] etc. as unsubscriptable in 3.9
2121
unsubscriptable-object,
22+
# pylint's static analysis causes false positivies for file_path();
23+
# If we really care to make it statically knowable, we'll use mypy.
24+
unbalanced-tuple-unpacking,
2225
# Sometimes we need to disable a newly introduced pylint warning.
2326
# Doing so should not produce a warning in older versions of pylint.
2427
bad-option-value,
2528
# These are temporary, and should be removed:
2629
missing-docstring,
2730
too-many-return-statements,
28-
too-many-statements
31+
too-many-statements,
32+
consider-using-f-string,
2933

3034
[FORMAT]
3135

tests/qemu-iotests/testrunner.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,13 @@ def do_run_test(self, test: str) -> TestResult:
266266
diff=file_diff(str(f_reference), str(f_bad)))
267267

268268
if f_notrun.exists():
269-
return TestResult(status='not run',
270-
description=f_notrun.read_text().strip())
269+
return TestResult(
270+
status='not run',
271+
description=f_notrun.read_text(encoding='utf-8').strip())
271272

272273
casenotrun = ''
273274
if f_casenotrun.exists():
274-
casenotrun = f_casenotrun.read_text()
275+
casenotrun = f_casenotrun.read_text(encoding='utf-8')
275276

276277
diff = file_diff(str(f_reference), str(f_bad))
277278
if diff:

0 commit comments

Comments
 (0)