Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate a cache directory even if the "cache" folder is not found (#…
…1499) ### What kind of change does this PR introduce? * Allows the `pytest` setup to load testing data into a cache folder even if the cache folder does not exist. ### Does this PR introduce a breaking change? No. ### Other information: Relevant traceback (conda-forge): ``` ==================================== ERRORS ==================================== _________________ ERROR at setup of TestSEuclidean.test_simple _________________ [gw0] linux -- Python 3.8.18 $PREFIX/bin/python3.8 When running pytest with multiple workers, one worker will copy data remotely to _default_cache_dir while other workers wait using lockfile. Once the lock is released, all workers will copy data to their local threadsafe_data_dir.""" if ( not _default_cache_dir.joinpath(helpers.TESTDATA_BRANCH).exists() or helpers.PREFETCH_TESTING_DATA ): if worker_id in "master": helpers.populate_testing_data(branch=helpers.TESTDATA_BRANCH) else: > _default_cache_dir.mkdir(exist_ok=True) tests/conftest.py:447: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = PosixPath('/home/conda/.cache/xclim-testdata'), mode = 511 parents = False, exist_ok = True def mkdir(self, mode=0o777, parents=False, exist_ok=False): """ Create a new directory at this given path. """ if self._closed: self._raise_closed() try: > self._accessor.mkdir(self, mode) E FileNotFoundError: [Errno 2] No such file or directory: '/home/conda/.cache/xclim-testdata' ../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib/python3.8/pathlib.py:1288: FileNotFoundError ```
- Loading branch information