preload.py 450 B

123456789101112131415161718
  1. """This file can be used to preload files needed for testing.
  2. For example you can use::
  3. cd setuptools/tests/config
  4. python -m downloads.preload setupcfg_examples.txt
  5. to make sure the `setup.cfg` examples are downloaded before starting the tests.
  6. """
  7. import sys
  8. from pathlib import Path
  9. from . import retrieve_file, urls_from_file
  10. if __name__ == "__main__":
  11. urls = urls_from_file(Path(sys.argv[1]))
  12. list(map(retrieve_file, urls))