Skip to content

Commit c5861bf

Browse files
committed
specify cached session debug name to actually cache urls
1 parent e9fda41 commit c5861bf

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
@@ -639,7 +639,7 @@ def test_inherited_coords(self, url=simplegroup_datatree_url) -> None:
639639

640640
_version_ = Version(pydap.__version__)
641641

642-
session = CachedSession()
642+
session = CachedSession(cache_name="debug") # so that urls are cached
643643
session.cache.clear()
644644

645645
tree = open_datatree(url, engine=self.engine, session=session)
@@ -653,15 +653,9 @@ def test_inherited_coords(self, url=simplegroup_datatree_url) -> None:
653653
list(expected.dims) + ["Z", "nv"]
654654
)
655655

656-
# group (including root). So in this case 3. In the future there
657-
# should a only be 2 downloads (all dimensions should be downloaded)
658-
# within single
659-
660656
if _version_ > Version("3.5.5"):
661-
# Total downloads are: 1 dmr, + 1 dap url per Group | root.
662-
# since there is a group then 2 dap url. In the future there
663-
# should only be 1 dap url downloaded.
664-
assert len(session.cache.urls()) == 3
657+
# Total downloads are: 1 dmr, + 1 dap url for all dimensions across groups
658+
assert len(session.cache.urls()) == 2
665659
else:
666660
# 1 dmr + 1 dap url per dimension (total there are 4 dimension arrays)
667661
assert len(session.cache.urls()) == 5

0 commit comments

Comments
 (0)