Skip to content

Commit

Permalink
Use temp paths in the test
Browse files Browse the repository at this point in the history
  • Loading branch information
deltamarnix committed Dec 13, 2024
1 parent fa21d42 commit f14ed45
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/test_dask_xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -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})
Expand Down

0 comments on commit f14ed45

Please sign in to comment.