aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2021-10-19 10:49:12 -0400
committerJohn Snow <jsnow@redhat.com>2021-11-01 11:54:59 -0400
commit7a90bcc269bb6f727cfd69b50128ecf4ab92e9af (patch)
tree025134f3cf07fa15af8d98495048e339b6c2ff47 /tests/qemu-iotests
parent752f425d832d1d4e00f39e80835dd249fb44e698 (diff)
iotests/297: update tool availability checks
As mentioned in 'iotests/297: Don't rely on distro-specific linter binaries', these checks are overly strict. Update them to be in-line with how we actually invoke the linters themselves. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Hanna Reitz <hreitz@redhat.com> Message-id: 20211019144918.3159078-10-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'tests/qemu-iotests')
-rwxr-xr-xtests/qemu-iotests/2979
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/qemu-iotests/297 b/tests/qemu-iotests/297
index 76d6a23f53..b2ad8d1cbe 100755
--- a/tests/qemu-iotests/297
+++ b/tests/qemu-iotests/297
@@ -18,7 +18,6 @@
import os
import re
-import shutil
import subprocess
import sys
from typing import List, Mapping, Optional
@@ -84,9 +83,11 @@ def run_linter(
def main() -> None:
- for linter in ('pylint-3', 'mypy'):
- if shutil.which(linter) is None:
- iotests.notrun(f'{linter} not found')
+ for linter in ('pylint', 'mypy'):
+ try:
+ run_linter(linter, ['--version'], suppress_output=True)
+ except subprocess.CalledProcessError:
+ iotests.notrun(f"'{linter}' not found")
files = get_test_files()