MCPcopy Create free account
hub / github.com/dask/dask / test_finish_task

Function test_finish_task

dask/tests/test_local.py:65–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63
64
65def test_finish_task():
66 dsk = {"x": 1, "y": 2, "z": (inc, "x"), "w": (add, "z", "y")}
67 sortkey = order(dsk).get
68 state = start_state_from_dask(dsk)
69 state["ready"].remove("z")
70 state["running"] = {"z", "other-task"}
71 task = "z"
72 result = 2
73
74 state["cache"]["z"] = result
75 finish_task(dsk, task, state, set(), sortkey)
76
77 assert state == {
78 "cache": {"y": 2, "z": 2},
79 "dependencies": {
80 "w": {"y", "z"},
81 "x": set(),
82 "y": set(),
83 "z": {"x"},
84 },
85 "finished": {"z"},
86 "released": {"x"},
87 "running": {"other-task"},
88 "dependents": {"w": set(), "x": {"z"}, "y": {"w"}, "z": {"w"}},
89 "ready": ["w"],
90 "waiting": {},
91 "waiting_data": {"w": set(), "y": {"w"}, "z": {"w"}},
92 }
93
94
95class TestGetAsync(GetFunctionTestMixin):

Callers

nothing calls this directly

Calls 5

orderFunction · 0.90
start_state_from_daskFunction · 0.90
finish_taskFunction · 0.90
setClass · 0.85
removeMethod · 0.80

Tested by

no test coverage detected