aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2021-10-19 10:49:06 -0400
committerJohn Snow <jsnow@redhat.com>2021-11-01 11:54:59 -0400
commit3c1d5012e8d46cd2e4084e9f995d4444b6c09076 (patch)
treeba8df77f54bb5a72e0b430fb66c5e161a5526184 /tests
parent8f7960fa3120806e0933795c6f34d8b5b09c622b (diff)
iotests/297: Add get_files() function
Split out file discovery into its own method to begin separating out configuration/setup and test execution. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Hanna Reitz <hreitz@redhat.com> Message-id: 20211019144918.3159078-4-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/qemu-iotests/2979
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/qemu-iotests/297 b/tests/qemu-iotests/297
index b8101e6024..15b54594c1 100755
--- a/tests/qemu-iotests/297
+++ b/tests/qemu-iotests/297
@@ -21,6 +21,7 @@ import re
import shutil
import subprocess
import sys
+from typing import List
import iotests
@@ -54,10 +55,14 @@ def is_python_file(filename):
return False
-def run_linters():
+def get_test_files() -> List[str]:
named_tests = [f'tests/{entry}' for entry in os.listdir('tests')]
check_tests = set(os.listdir('.') + named_tests) - set(SKIP_FILES)
- files = [filename for filename in check_tests if is_python_file(filename)]
+ return list(filter(is_python_file, check_tests))
+
+
+def run_linters():
+ files = get_test_files()
iotests.logger.debug('Files to be checked:')
iotests.logger.debug(', '.join(sorted(files)))