()
| 63 | |
| 64 | |
| 65 | def 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 | |
| 95 | class TestGetAsync(GetFunctionTestMixin): |
nothing calls this directly
no test coverage detected