[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/13] iotests/297: Create main() function
From: |
John Snow |
Subject: |
[PATCH 05/13] iotests/297: Create main() function |
Date: |
Mon, 4 Oct 2021 17:04:55 -0400 |
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>
---
tests/qemu-iotests/297 | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/tests/qemu-iotests/297 b/tests/qemu-iotests/297
index 65b1e7058c2..f9fcb039e27 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)
--
2.31.1
- [PATCH 00/13] python/iotests: Run iotest linters during Python CI, John Snow, 2021/10/04
- [PATCH 02/13] iotests/297: Split mypy configuration out into mypy.ini, John Snow, 2021/10/04
- [PATCH 01/13] iotests/297: Move pylint config into pylintrc, John Snow, 2021/10/04
- [PATCH 03/13] iotests/297: Add get_files() function, John Snow, 2021/10/04
- [PATCH 05/13] iotests/297: Create main() function,
John Snow <=
- [PATCH 07/13] iotests/297: Split run_linters apart into run_pylint and run_mypy, John Snow, 2021/10/04
- [PATCH 06/13] iotests/297: Separate environment setup from test execution, John Snow, 2021/10/04
- [PATCH 04/13] iotests/297: Don't rely on distro-specific linter binaries, John Snow, 2021/10/04
- [PATCH 10/13] iotests/linters: Add entry point for linting via Python CI, John Snow, 2021/10/04