diff --git a/debug/testlib.py b/debug/testlib.py index 1d3fd1880..6d07a31b1 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -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(