Skip to content

Commit 9ed0102

Browse files
authored
Silence warnings from test_tutorial.py (#10661)
1 parent d4fcd2b commit 9ed0102

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

xarray/tests/test_tutorial.py

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,27 @@
99
class TestLoadDataset:
1010
def test_download_from_github(self, tmp_path) -> None:
1111
cache_dir = tmp_path / tutorial._default_cache_dir_name
12-
ds = tutorial.open_dataset("tiny", cache_dir=cache_dir).load()
12+
ds = tutorial.load_dataset("tiny", cache_dir=cache_dir)
1313
tiny = DataArray(range(5), name="tiny").to_dataset()
1414
assert_identical(ds, tiny)
1515

16-
def test_download_from_github_load_without_cache(
17-
self, tmp_path, monkeypatch
18-
) -> None:
16+
def test_download_from_github_load_without_cache(self, tmp_path) -> None:
1917
cache_dir = tmp_path / tutorial._default_cache_dir_name
20-
21-
ds_nocache = tutorial.open_dataset(
22-
"tiny", cache=False, cache_dir=cache_dir
23-
).load()
24-
ds_cache = tutorial.open_dataset("tiny", cache_dir=cache_dir).load()
18+
ds_nocache = tutorial.load_dataset("tiny", cache=False, cache_dir=cache_dir)
19+
ds_cache = tutorial.load_dataset("tiny", cache_dir=cache_dir)
2520
assert_identical(ds_cache, ds_nocache)
2621

2722

2823
@network
2924
class TestLoadDataTree:
3025
def test_download_from_github(self, tmp_path) -> None:
3126
cache_dir = tmp_path / tutorial._default_cache_dir_name
32-
ds = tutorial.open_datatree("tiny", cache_dir=cache_dir).load()
27+
ds = tutorial.load_datatree("tiny", cache_dir=cache_dir)
3328
tiny = DataTree.from_dict({"/": DataArray(range(5), name="tiny").to_dataset()})
3429
assert_identical(ds, tiny)
3530

36-
def test_download_from_github_load_without_cache(
37-
self, tmp_path, monkeypatch
38-
) -> None:
31+
def test_download_from_github_load_without_cache(self, tmp_path) -> None:
3932
cache_dir = tmp_path / tutorial._default_cache_dir_name
40-
41-
ds_nocache = tutorial.open_datatree(
42-
"tiny", cache=False, cache_dir=cache_dir
43-
).load()
44-
ds_cache = tutorial.open_datatree("tiny", cache_dir=cache_dir).load()
33+
ds_nocache = tutorial.load_datatree("tiny", cache=False, cache_dir=cache_dir)
34+
ds_cache = tutorial.load_datatree("tiny", cache_dir=cache_dir)
4535
assert_identical(ds_cache, ds_nocache)

0 commit comments

Comments
 (0)