aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vrbka <marek.vrbka@codasip.com>2024-05-02 15:14:09 +0200
committerMarek Vrbka <marek.vrbka@codasip.com>2024-05-02 15:44:57 +0200
commit203362f8719d0eb24ea64b7cf4a7a2ae4ab8796b (patch)
treeeca4259e14be1e2b928c13f9efd983c6c7d19f7e
parent1dde0ef3bee0d3f86c6f41796f28625924dc6ba0 (diff)
downloadriscv-tests-203362f8719d0eb24ea64b7cf4a7a2ae4ab8796b.zip
riscv-tests-203362f8719d0eb24ea64b7cf4a7a2ae4ab8796b.tar.gz
riscv-tests-203362f8719d0eb24ea64b7cf4a7a2ae4ab8796b.tar.bz2
debug: Fix loading of empty exclude lists with comments
This patch fixes the case when we are using an empty exception list (for example just a YAML file with comments but without any test items to skip).
-rw-r--r--debug/testlib.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/debug/testlib.py b/debug/testlib.py
index 1d3fd18..d4826bb 100644
--- a/debug/testlib.py
+++ b/debug/testlib.py
@@ -1076,12 +1076,16 @@ class PrivateState:
def load_excluded_tests(excluded_tests_file, target_name):
result = []
- if excluded_tests_file is None or len(excluded_tests_file) == 0:
+ if excluded_tests_file is None:
+ # No list of excluded tests was specified
return result
target_excludes = {}
with open(excluded_tests_file, encoding="utf-8") as file:
raw_data = yaml.safe_load(file)
+ if raw_data is None:
+ # File contains no targets
+ return result
for (target, test_list) in raw_data.items():
if not isinstance(test_list, list):
raise ValueError(