Skip to content

Commit f14ed45

Browse files
committed
Use temp paths in the test
1 parent fa21d42 commit f14ed45

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/test_dask_xarray.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
# Instead we need to loop over the blocks and compute them one by one. (test 2)
1010

1111

12-
def test_netcdf_with_map_blocks():
12+
def test_netcdf_with_map_blocks(tmp_path):
1313
data = xr.DataArray(range(1, 1_000), dims=("x",))
14-
nc_path = "test/data/test.nc"
14+
nc_path = tmp_path / "test_netcdf_with_map_blocks.nc"
1515
data.to_netcdf(nc_path)
1616
data.close()
1717
data = xr.open_dataarray(nc_path, chunks={"x": 100})
@@ -36,9 +36,9 @@ def append_to_output_file(block):
3636
assert len(output_file) == 10
3737

3838

39-
def test_netcdf_with_dask_map_blocks():
39+
def test_netcdf_with_dask_map_blocks(tmp_path):
4040
data = xr.DataArray(range(1, 1_000), dims=("x",))
41-
nc_path = "test/data/test.nc"
41+
nc_path = tmp_path / "test_netcdf_with_dask_map_blocks.nc"
4242
data.to_netcdf(nc_path)
4343
data.close()
4444
data = xr.open_dataarray(nc_path, chunks={"x": 100})

0 commit comments

Comments
 (0)