| 3088 | @pytest.mark.parametrize("asarray", [da.asarray, da.asanyarray]) |
| 3089 | @pytest.mark.parametrize("inline_array", [True, False]) |
| 3090 | def test_asarray_h5py(asarray, inline_array): |
| 3091 | h5py = pytest.importorskip("h5py") |
| 3092 | |
| 3093 | with tmpfile(".hdf5") as fn: |
| 3094 | with h5py.File(fn, mode="a") as f: |
| 3095 | d = f.create_dataset("/x", shape=(2, 2), dtype=float) |
| 3096 | x = asarray(d, inline_array=inline_array) |
| 3097 | |
| 3098 | # Check for the array in the dsk |
| 3099 | dsk = dict(x.dask) |
| 3100 | assert (d in dsk.values()) is not inline_array |
| 3101 | assert not any(isinstance(v, np.ndarray) for v in dsk.values()) |
| 3102 | |
| 3103 | |
| 3104 | def test_asarray_chunks(): |