test_script: Fix path computation in find_js_test_files.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-07-18 00:43:07 -07:00 committed by Tim Abbott
parent a63a23087f
commit 0940f29a68
1 changed files with 6 additions and 2 deletions

View File

@ -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))