Skip to content

Commit

Permalink
Fix filtering in test fetcher utils (huggingface#13766)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgugger authored and Alberto Bégué committed Jan 27, 2022
1 parent f990953 commit fef20c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/tests_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,10 @@ def infer_tests_to_run(output_file, diff_with_last_commit=False, filters=None):
# Make sure we did not end up with a test file that was removed
test_files_to_run = [f for f in test_files_to_run if os.path.isfile(f) or os.path.isdir(f)]
if filters is not None:
filtered_files = []
for filter in filters:
test_files_to_run = [f for f in test_files_to_run if f.startswith(filter)]
filtered_files.extend([f for f in test_files_to_run if f.startswith(filter)])
test_files_to_run = filtered_files

print(f"\n### TEST TO RUN ###\n{_print_list(test_files_to_run)}")
if len(test_files_to_run) > 0:
Expand Down

0 comments on commit fef20c0

Please sign in to comment.