From 0940f29a68ecd014b5a7dd256aa7a2fcd7ca3386 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sun, 18 Jul 2021 00:43:07 -0700 Subject: [PATCH] test_script: Fix path computation in find_js_test_files. Signed-off-by: Anders Kaseorg --- tools/lib/test_script.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/lib/test_script.py b/tools/lib/test_script.py index f9764f6c51..e2e862891d 100644 --- a/tools/lib/test_script.py +++ b/tools/lib/test_script.py @@ -106,8 +106,12 @@ def find_js_test_files(test_dir: str, files: Iterable[str]) -> List[str]: test_files = [] for file in files: file = min( - (file_name for file_name in os.listdir(test_dir) if file_name.startswith(file)), - default=os.path.join(test_dir, file), + ( + os.path.join(test_dir, file_name) + for file_name in os.listdir(test_dir) + if file_name.startswith(file) + ), + default=file, ) test_files.append(os.path.abspath(file))