diff --git a/CHANGES.rst b/CHANGES.rst index 8bdb893f5..b307c4ae0 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -21,6 +21,7 @@ Bug fixes * Calling a ``sdba.map_blocks``-wrapped function with data chunked along the reduced dimensions will raise an error. This forbids chunking the trained dataset along the distribution dimensions, for example. (:issue:`1481`, :pull:`1482`). * Optimization of indicators ``huglin_index`` and ``biologically_effective_degree_days`` when used with dask and flox. As a side effect, the indice functions (i.e. under ``xc.indices``) no longer mask incomplete periods. The indicators' output is unchanged under the default "check_missing" setting (:issue:`1494`, :pull:`1495`). * Fixed ``xclim.indices.run_length.lazy_indexing`` which would sometimes trigger the loading of auxiliary coordinates. (:issue:`1483`, :pull:`1484`). +* Fixed a bug in the `pytest` configuration that could prevent testing data caching from occurring in systems where the platform-dependent cache directory is not found in the user's home. (:issue:`1468`, :pull:`1473`). Breaking changes ^^^^^^^^^^^^^^^^ diff --git a/tests/conftest.py b/tests/conftest.py index c3e5404d2..b1afa8b23 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -450,7 +450,7 @@ def gather_session_data(threadsafe_data_dir, worker_id, xdoctest_namespace): if worker_id in "master": helpers.populate_testing_data(branch=helpers.TESTDATA_BRANCH) else: - _default_cache_dir.mkdir(exist_ok=True) + _default_cache_dir.mkdir(exist_ok=True, parents=True) test_data_being_written = FileLock(_default_cache_dir.joinpath(".lock")) with test_data_being_written as fl: # This flag prevents multiple calls from re-attempting to download testing data in the same pytest run diff --git a/xclim/testing/utils.py b/xclim/testing/utils.py index ecd202c51..b4ca456eb 100644 --- a/xclim/testing/utils.py +++ b/xclim/testing/utils.py @@ -232,7 +232,7 @@ def _get( if not local_file.is_file(): # This will always leave this directory on disk. # We may want to add an option to remove it. - local_file.parent.mkdir(parents=True, exist_ok=True) + local_file.parent.mkdir(exist_ok=True, parents=True) url = "/".join((github_url, "raw", branch, fullname.as_posix())) logger.info(f"Fetching remote file: {fullname.as_posix()}")