| 3098 | @pytest.mark.parametrize("asarray", [da.asarray, da.asanyarray]) |
| 3099 | @pytest.mark.parametrize("inline_array", [True, False]) |
| 3100 | def test_asarray_h5py(asarray, inline_array): |
| 3101 | h5py = pytest.importorskip("h5py") |
| 3102 | |
| 3103 | with tmpfile(".hdf5") as fn: |
| 3104 | with h5py.File(fn, mode="a") as f: |
| 3105 | d = f.create_dataset("/x", shape=(2, 2), dtype=float) |
| 3106 | x = asarray(d, inline_array=inline_array) |
| 3107 | |
| 3108 | # Check for the array in the dsk |
| 3109 | dsk = dict(x.dask) |
| 3110 | assert (d in dsk.values()) is not inline_array |
| 3111 | assert not any(isinstance(v, np.ndarray) for v in dsk.values()) |
| 3112 | |
| 3113 | |
| 3114 | def test_asarray_chunks(): |