diff options
author | John Snow <jsnow@redhat.com> | 2023-02-09 19:31:41 -0500 |
---|---|---|
committer | John Snow <jsnow@redhat.com> | 2023-02-22 23:35:03 -0500 |
commit | aef633e76504f6f2f3be47a22b271ce6469c0d9d (patch) | |
tree | 3ec6a17f9b0f3f6314cdc8428dad6097f006a43e /tests | |
parent | 79b677d658d3d35e1e776826ac4abb28cdce69b8 (diff) |
python: support pylint 2.16
Pylint 2.16 adds a few new checks that cause the optional check-tox CI
job to fail.
1. The superfluous-parens check seems to be a bit more aggressive,
2. broad-exception-raised is new; it discourages "raise Exception".
Fix these minor issues and turn the lights green.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Beraldo Leal <bleal@redhat.com>
Message-id: 20230210003147.1309376-2-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/qemu-iotests/iotests.py | 4 | ||||
-rwxr-xr-x | tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 94aeb3f3b2..3e82c634cf 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -720,7 +720,7 @@ class Timeout: signal.setitimer(signal.ITIMER_REAL, 0) return False def timeout(self, signum, frame): - raise Exception(self.errmsg) + raise TimeoutError(self.errmsg) def file_pattern(name): return "{0}-{1}".format(os.getpid(), name) @@ -804,7 +804,7 @@ def remote_filename(path): elif imgproto == 'ssh': return "ssh://%s@127.0.0.1:22%s" % (os.environ.get('USER'), path) else: - raise Exception("Protocol %s not supported" % (imgproto)) + raise ValueError("Protocol %s not supported" % (imgproto)) class VM(qtest.QEMUQtestMachine): '''A QEMU VM''' diff --git a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test b/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test index fc9c4b4ef4..dda55fad28 100755 --- a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test +++ b/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test @@ -84,7 +84,7 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase): e['vm'] = 'SRC' for e in self.vm_b_events: e['vm'] = 'DST' - events = (self.vm_a_events + self.vm_b_events) + events = self.vm_a_events + self.vm_b_events events = [(e['timestamp']['seconds'], e['timestamp']['microseconds'], e['vm'], |