Skip to content

Commit

Permalink
Add script that allow users to preload examples for offline testing
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Apr 1, 2022
1 parent c0f7966 commit 3d752cb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions setuptools/tests/config/downloads/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*
!.gitignore
!__init__.py
!preload.py
18 changes: 18 additions & 0 deletions setuptools/tests/config/downloads/preload.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""This file can be used to preload files needed for testing.
For example you can use::
cd setuptools/tests/config
python -m downloads.preload setupcfg_examples.txt
to make sure the `setup.cfg` examples are downloaded before starting the tests.
"""
import sys
from pathlib import Path

from . import retrieve_file, urls_from_file


if __name__ == "__main__":
urls = urls_from_file(Path(sys.argv[1]))
list(map(retrieve_file, urls))

0 comments on commit 3d752cb

Please sign in to comment.