aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2021-10-19 10:49:07 -0400
committerJohn Snow <jsnow@redhat.com>2021-11-01 11:54:59 -0400
commit447aebda3f461de159280c4896a537395aac8e90 (patch)
treea67d024d206d904d0bf2434fa9ec3b002ad3c5a2 /tests
parent3c1d5012e8d46cd2e4084e9f995d4444b6c09076 (diff)
iotests/297: Create main() function
Instead of running "run_linters" directly, create a main() function that will be responsible for environment setup, leaving run_linters() responsible only for execution of the linters. (That environment setup will be moved over in forthcoming commits.) Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Hanna Reitz <hreitz@redhat.com> Message-id: 20211019144918.3159078-5-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/qemu-iotests/29712
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/qemu-iotests/297 b/tests/qemu-iotests/297
index 15b54594c1..163ebc8ebf 100755
--- a/tests/qemu-iotests/297
+++ b/tests/qemu-iotests/297
@@ -89,8 +89,12 @@ def run_linters():
print(p.stdout)
-for linter in ('pylint-3', 'mypy'):
- if shutil.which(linter) is None:
- iotests.notrun(f'{linter} not found')
+def main() -> None:
+ for linter in ('pylint-3', 'mypy'):
+ if shutil.which(linter) is None:
+ iotests.notrun(f'{linter} not found')
-iotests.script_main(run_linters)
+ run_linters()
+
+
+iotests.script_main(main)