Skip to content

Commit c244b3a

Browse files
committed
specify cached session debug name to actually cache urls
1 parent ccd7954 commit c244b3a

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

xarray/tests/test_backends.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5975,7 +5975,7 @@ def test_batchdap4_downloads(protocol, batch) -> None:
59755975
from requests_cache import CachedSession
59765976

59775977
_version_ = Version(pydap.__version__)
5978-
session = CachedSession()
5978+
session = CachedSession(cache_name="debug") # so that urls are cached
59795979
session.cache.clear()
59805980
url = "https://test.opendap.org/opendap/hyrax/data/nc/coads_climatology.nc"
59815981

xarray/tests/test_backends_datatree.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ def test_inherited_coords(self, url=simplegroup_datatree_url) -> None:
500500

501501
_version_ = Version(pydap.__version__)
502502

503-
session = CachedSession()
503+
session = CachedSession(cache_name="debug") # so that urls are cached
504504
session.cache.clear()
505505

506506
tree = open_datatree(url, engine=self.engine, session=session)
@@ -514,15 +514,9 @@ def test_inherited_coords(self, url=simplegroup_datatree_url) -> None:
514514
list(expected.dims) + ["Z", "nv"]
515515
)
516516

517-
# group (including root). So in this case 3. In the future there
518-
# should a only be 2 downloads (all dimensions should be downloaded)
519-
# within single
520-
521517
if _version_ > Version("3.5.5"):
522-
# Total downloads are: 1 dmr, + 1 dap url per Group | root.
523-
# since there is a group then 2 dap url. In the future there
524-
# should only be 1 dap url downloaded.
525-
assert len(session.cache.urls()) == 3
518+
# Total downloads are: 1 dmr, + 1 dap url for all dimensions across groups
519+
assert len(session.cache.urls()) == 2
526520
else:
527521
# 1 dmr + 1 dap url per dimension (total there are 4 dimension arrays)
528522
assert len(session.cache.urls()) == 5

0 commit comments

Comments
 (0)