MCPcopy Index your code
hub / github.com/pydata/xarray / test_resize

Function test_resize

xarray/tests/test_backends_lru_cache.py:77–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75
76
77def test_resize() -> None:
78 cache: LRUCache[Any, Any] = LRUCache(maxsize=2)
79 assert cache.maxsize == 2
80 cache["w"] = 0
81 cache["x"] = 1
82 cache["y"] = 2
83 assert list(cache.items()) == [("x", 1), ("y", 2)]
84 cache.maxsize = 10
85 cache["z"] = 3
86 assert list(cache.items()) == [("x", 1), ("y", 2), ("z", 3)]
87 cache.maxsize = 1
88 assert list(cache.items()) == [("z", 3)]
89
90 with pytest.raises(ValueError):
91 cache.maxsize = -1

Callers

nothing calls this directly

Calls 2

LRUCacheClass · 0.90
itemsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…