Skip to content

Commit c3e3837

Browse files
More concise whitelist logic
1 parent 6bd9c78 commit c3e3837

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

betterproto/tests/generate.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@ def generate(whitelist: Set[str]):
1818
test_case_names = set(get_directories(inputs_path))
1919

2020
for test_case_name in sorted(test_case_names):
21-
test_case_path = os.path.join(inputs_path, test_case_name)
21+
test_case_path = os.path.realpath(os.path.join(inputs_path, test_case_name))
2222

23-
is_path_whitelisted = path_whitelist and os.path.realpath(test_case_path) in path_whitelist
24-
is_name_whitelisted = name_whitelist and test_case_name in name_whitelist
25-
26-
if whitelist and not is_path_whitelisted and not is_name_whitelisted:
23+
if whitelist and test_case_path not in path_whitelist and test_case_name not in name_whitelist:
2724
continue
2825

2926
case_output_dir_reference = os.path.join(output_path_reference, test_case_name)

0 commit comments

Comments
 (0)