Skip to content

Commit 5993002

Browse files
committed
specify cached session debug name to actually cache urls
1 parent 3d90ba5 commit 5993002

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
@@ -6459,7 +6459,7 @@ def test_batchdap4_downloads(protocol, batch) -> None:
64596459
from requests_cache import CachedSession
64606460

64616461
_version_ = Version(pydap.__version__)
6462-
session = CachedSession()
6462+
session = CachedSession(cache_name="debug") # so that urls are cached
64636463
session.cache.clear()
64646464
url = "https://test.opendap.org/opendap/hyrax/data/nc/coads_climatology.nc"
64656465

xarray/tests/test_backends_datatree.py

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

646646
_version_ = Version(pydap.__version__)
647647

648-
session = CachedSession()
648+
session = CachedSession(cache_name="debug") # so that urls are cached
649649
session.cache.clear()
650650

651651
tree = open_datatree(url, engine=self.engine, session=session)
@@ -659,15 +659,9 @@ def test_inherited_coords(self, url=simplegroup_datatree_url) -> None:
659659
list(expected.dims) + ["Z", "nv"]
660660
)
661661

662-
# group (including root). So in this case 3. In the future there
663-
# should a only be 2 downloads (all dimensions should be downloaded)
664-
# within single
665-
666662
if _version_ > Version("3.5.5"):
667-
# Total downloads are: 1 dmr, + 1 dap url per Group | root.
668-
# since there is a group then 2 dap url. In the future there
669-
# should only be 1 dap url downloaded.
670-
assert len(session.cache.urls()) == 3
663+
# Total downloads are: 1 dmr, + 1 dap url for all dimensions across groups
664+
assert len(session.cache.urls()) == 2
671665
else:
672666
# 1 dmr + 1 dap url per dimension (total there are 4 dimension arrays)
673667
assert len(session.cache.urls()) == 5

0 commit comments

Comments
 (0)