Skip to content

Commit

Permalink
debug: Fix loading of empty exclude lists with comments
Browse files Browse the repository at this point in the history
This patch fixes the loading of test exclusion lists when they contain comments. eg. they are not completely empty.
  • Loading branch information
MarekVCodasip committed May 2, 2024
1 parent 1dde0ef commit d24ca89
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion debug/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1076,12 +1076,15 @@ def __exit__(self, _type, _value, _traceback):

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:
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(
Expand Down

0 comments on commit d24ca89

Please sign in to comment.