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

Function test_assert_eq_scheduler

dask/array/tests/test_array_utils.py:128–143  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

126 ],
127)
128def test_assert_eq_scheduler(a, b):
129 counter = 0 # Counts how many times `custom_scheduler` is executed.
130
131 def custom_scheduler(*args, **kwargs):
132 nonlocal counter
133 counter += 1
134 return get_sync(*args, **kwargs)
135
136 assert_eq(a, b)
137 assert counter == 0
138
139 assert_eq(a, b, scheduler=custom_scheduler)
140 # `custom_scheduler` should be executed 2x the number of arrays.
141 # Once in `persist` and once in `compute`
142 n_da_arrays = len([x for x in [a, b] if isinstance(x, Array)]) * 2
143 assert counter == n_da_arrays

Callers

nothing calls this directly

Calls 1

assert_eqFunction · 0.90

Tested by

no test coverage detected