Skip to content

Commit caeca16

Browse files
committed
Use tmp_path fixture in range validation test to avoid read-only filesystem errors
1 parent bca0aad commit caeca16

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

tests/test_subset_range_validation.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55

66
import pytest
77

8-
from herbie import Herbie, config
8+
from herbie import Herbie
99

1010
now = datetime.now()
1111
today = datetime(now.year, now.month, now.day, now.hour) - timedelta(hours=6)
1212

13-
save_dir = config["default"]["save_dir"] / "Herbie-Tests-Data/"
1413

15-
16-
def test_subset_raises_on_non_206_response():
14+
def test_subset_raises_on_non_206_response(tmp_path):
1715
"""RuntimeError should fire when the server returns 200 instead of 206.
1816
1917
This prevents the silent disk-space blowup described in issue #514:
@@ -25,7 +23,7 @@ def test_subset_raises_on_non_206_response():
2523
today,
2624
model="hrrr",
2725
product="sfc",
28-
save_dir=save_dir,
26+
save_dir=tmp_path,
2927
overwrite=True,
3028
)
3129

0 commit comments

Comments
 (0)