()
| 53 | |
| 54 | |
| 55 | def test_cache_correctness(): |
| 56 | # https://github.com/dask/dask/issues/3631 |
| 57 | c = Cache(10000) |
| 58 | pytest.importorskip("numpy") |
| 59 | da = pytest.importorskip("dask.array") |
| 60 | from numpy import ones, zeros |
| 61 | |
| 62 | z = da.from_array(zeros(1), chunks=10) |
| 63 | o = da.from_array(ones(1), chunks=10) |
| 64 | with c: |
| 65 | assert (z.compute() == 0).all() |
| 66 | assert (o.compute() == 1).all() |
| 67 | |
| 68 | |
| 69 | def f(duration, size, *args): |