From 4e529065dd038a4fcd359a83a76c7775c1e17105 Mon Sep 17 00:00:00 2001 From: ydshieh Date: Wed, 18 Sep 2024 13:35:29 +0200 Subject: [PATCH] fix --- utils/tests_fetcher.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/utils/tests_fetcher.py b/utils/tests_fetcher.py index 6c799c823fbac5..b8408f9d4538d9 100644 --- a/utils/tests_fetcher.py +++ b/utils/tests_fetcher.py @@ -1148,21 +1148,19 @@ def parse_commit_message(commit_message: str) -> Dict[str, bool]: "pipelines_torch": r"tests/models/.*/test_modeling_(?!(?:flax_|tf_)).*", "tests_hub": r"tests/.*", "tests_onnx": r"tests/models/.*/test_modeling_(?:tf_|(?!flax)).*", - "tests_non_model": r"tests/.*?/test_.*\.py", + "tests_non_model": r"tests/[^/]*?/test_.*\.py", } def create_test_list_from_filter(full_test_list, out_path): all_test_files = "\n".join(full_test_list) for job_name, _filter in JOB_TO_TEST_FILE.items(): - print(job_name) file_name = os.path.join(out_path, f"{job_name}_test_list.txt") if job_name == "tests_hub": files_to_test = ["tests"] else: files_to_test = list(re.findall(_filter, all_test_files)) print(job_name, file_name) - print(len(files_to_test)) if len(files_to_test) > 0: # No tests -> no file with test list with open(file_name, "w") as f: f.write("\n".join(files_to_test))