aboutsummaryrefslogtreecommitdiff
path: root/run_project_tests.py
diff options
context:
space:
mode:
authorTristan Partin <tristan@partin.io>2023-08-14 17:51:51 -0500
committerEli Schwartz <eschwartz93@gmail.com>2023-10-04 15:23:00 -0400
commit1991ad87061d068413cb6a593f3f29c9426df2b9 (patch)
treef84cc2915a28508b886f5b1408d9449efed31a30 /run_project_tests.py
parent88b337b77c264d3f39744b3b3bea8a29778a73c4 (diff)
downloadmeson-1991ad87061d068413cb6a593f3f29c9426df2b9.zip
meson-1991ad87061d068413cb6a593f3f29c9426df2b9.tar.gz
meson-1991ad87061d068413cb6a593f3f29c9426df2b9.tar.bz2
Remove type comments in run_project_tests.py
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-xrun_project_tests.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index 7413c68..7ff1640 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -134,11 +134,11 @@ class InstalledFile:
self.path = raw['file']
self.typ = raw['type']
self.platform = raw.get('platform', None)
- self.language = raw.get('language', 'c') # type: str
+ self.language = raw.get('language', 'c')
- version = raw.get('version', '') # type: str
+ version = raw.get('version', '')
if version:
- self.version = version.split('.') # type: T.List[str]
+ self.version = version.split('.')
else:
# split on '' will return [''], we want an empty list though
self.version = []
@@ -280,9 +280,9 @@ class TestDef:
self.args = args
self.skip = skip
self.env = os.environ.copy()
- self.installed_files = [] # type: T.List[InstalledFile]
- self.do_not_set_opts = [] # type: T.List[str]
- self.stdout = [] # type: T.List[T.Dict[str, str]]
+ self.installed_files: T.List[InstalledFile] = []
+ self.do_not_set_opts: T.List[str] = []
+ self.stdout: T.List[T.Dict[str, str]] = []
self.skip_category = skip_category
self.skip_expected = False
@@ -399,7 +399,7 @@ def platform_fix_name(fname: str, canonical_compiler: str, env: environment.Envi
def validate_install(test: TestDef, installdir: Path, env: environment.Environment) -> str:
ret_msg = ''
- expected_raw = [] # type: T.List[Path]
+ expected_raw: T.List[Path] = []
for i in test.installed_files:
try:
expected_raw += i.get_paths(host_c_compiler, env, installdir)
@@ -828,7 +828,7 @@ def load_test_json(t: TestDef, stdout_mandatory: bool, skip_category: bool = Fal
test_def = json.loads(test_def_file.read_text(encoding='utf-8'))
# Handle additional environment variables
- env = {} # type: T.Dict[str, str]
+ env: T.Dict[str, str] = {}
if 'env' in test_def:
assert isinstance(test_def['env'], dict)
env = test_def['env']
@@ -838,7 +838,7 @@ def load_test_json(t: TestDef, stdout_mandatory: bool, skip_category: bool = Fal
env[key] = val
# Handle installed files
- installed = [] # type: T.List[InstalledFile]
+ installed: T.List[InstalledFile] = []
if 'installed' in test_def:
installed = [InstalledFile(x) for x in test_def['installed']]
@@ -848,7 +848,7 @@ def load_test_json(t: TestDef, stdout_mandatory: bool, skip_category: bool = Fal
raise RuntimeError(f"{test_def_file} must contain a non-empty stdout key")
# Handle the do_not_set_opts list
- do_not_set_opts = test_def.get('do_not_set_opts', []) # type: T.List[str]
+ do_not_set_opts: T.List[str] = test_def.get('do_not_set_opts', [])
(t.skip, t.skip_expected) = _skip_keys(test_def)
@@ -872,12 +872,12 @@ def load_test_json(t: TestDef, stdout_mandatory: bool, skip_category: bool = Fal
new_opt_list: T.List[T.List[T.Tuple[str, str, bool, bool]]]
# 'matrix; entry is present, so build multiple tests from matrix definition
- opt_list = [] # type: T.List[T.List[T.Tuple[str, str, bool, bool]]]
+ opt_list: T.List[T.List[T.Tuple[str, str, bool, bool]]] = []
matrix = test_def['matrix']
assert "options" in matrix
for key, val in matrix["options"].items():
assert isinstance(val, list)
- tmp_opts = [] # type: T.List[T.Tuple[str, str, bool, bool]]
+ tmp_opts: T.List[T.Tuple[str, str, bool, bool]] = []
for i in val:
assert isinstance(i, dict)
assert "val" in i