MCPcopy
hub / github.com/dask/dask / test_cache

Function test_cache

dask/tests/test_cache.py:24–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22
23
24def test_cache():
25 c = cachey.Cache(10000)
26 cc = Cache(c)
27
28 with cc:
29 assert get({"x": (inc, 1)}, "x") == 2
30
31 assert flag == [1]
32 assert c.data["x"] == 2
33
34 assert not cc.starttimes
35 assert not cc.durations
36
37 while flag:
38 flag.pop()
39 dsk = {"x": (inc, 1), "y": (inc, 2), "z": (add, "x", "y")}
40 with cc:
41 assert get(dsk, "z") == 5
42
43 assert flag == [2] # no x present
44
45 assert not Callback.active
46
47
48def test_cache_with_number():

Callers

nothing calls this directly

Calls 3

CacheClass · 0.90
getFunction · 0.90
popMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…