From f14ed4519c056dd1230fdbcc417f154c102fc769 Mon Sep 17 00:00:00 2001 From: Marnix Date: Fri, 13 Dec 2024 08:18:52 +0100 Subject: [PATCH] Use temp paths in the test --- test/test_dask_xarray.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/test_dask_xarray.py b/test/test_dask_xarray.py index 1112709..f03c06e 100644 --- a/test/test_dask_xarray.py +++ b/test/test_dask_xarray.py @@ -9,9 +9,9 @@ # Instead we need to loop over the blocks and compute them one by one. (test 2) -def test_netcdf_with_map_blocks(): +def test_netcdf_with_map_blocks(tmp_path): data = xr.DataArray(range(1, 1_000), dims=("x",)) - nc_path = "test/data/test.nc" + nc_path = tmp_path / "test_netcdf_with_map_blocks.nc" data.to_netcdf(nc_path) data.close() data = xr.open_dataarray(nc_path, chunks={"x": 100}) @@ -36,9 +36,9 @@ def append_to_output_file(block): assert len(output_file) == 10 -def test_netcdf_with_dask_map_blocks(): +def test_netcdf_with_dask_map_blocks(tmp_path): data = xr.DataArray(range(1, 1_000), dims=("x",)) - nc_path = "test/data/test.nc" + nc_path = tmp_path / "test_netcdf_with_dask_map_blocks.nc" data.to_netcdf(nc_path) data.close() data = xr.open_dataarray(nc_path, chunks={"x": 100})