Skip to content

Commit 0b1e3ba

Browse files
author
bruvio
committed
more refactoring to test for windows CI
1 parent 46a5be3 commit 0b1e3ba

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/conftest.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@ def dataset_variable_2d() -> Tuple[List, List, List]:
5656

5757
@pytest.fixture
5858
def test_dataset() -> netCDF4.Dataset:
59-
path = os.curdir
60-
if os.path.exists(f"{path}test.nc"):
61-
os.remove(f"{path}test.nc")
62-
return netCDF4.Dataset(f"{path}test.nc", "w", format="NETCDF4")
59+
path = os.path.join(os.curdir, "tmp")
60+
61+
filename = f"test-{fdp_utils.random_hash()}.nc"
62+
if os.path.exists(f"{path}{os.sep}{filename}"):
63+
os.remove(f"{path}{os.sep}{filename}")
64+
65+
return netCDF4.Dataset(f"{path}{os.sep}{filename}", "w", format="NETCDF4")
6366

6467

6568
@pytest.fixture

0 commit comments

Comments
 (0)