Skip to content

Commit

Permalink
Ensure iterator is consumed in tools/cache_urls_for_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Sep 25, 2024
1 parent 6d0e71d commit c23edc4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/cache_urls_for_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def download(url):

def download_all(cache: str):
with ThreadPoolExecutor(max_workers=5) as executor:
executor.map(download, set(iter_test_urls()))
return list(executor.map(download, set(iter_test_urls()))) # Consume iterator


if __name__ == "__main__":
Expand All @@ -47,4 +47,7 @@ def download_all(cache: str):
raise SystemExit("Please define VALIDATE_PYPROJECT_CACHE_REMOTE")

Path(cache).mkdir(parents=True, exist_ok=True)
download_all(cache)
downloads = download_all(cache)
assert len(downloads) > 0, f"empty {downloads=!r}" # noqa
files = list(map(print, Path(cache).iterdir()))
assert len(files) > 0, f"empty {files=!r}" # noqa

1 comment on commit c23edc4

@abravalheri
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a problem with the upload-artifact action.

actions/upload-artifact#618

Please sign in to comment.