| 9691 | {"typestr": "(0,)f8,", "shape": (1, 3)}, |
| 9692 | ]) |
| 9693 | def test_interface_nullptr(iface): |
| 9694 | iface.update({"data": (0, True)}) |
| 9695 | |
| 9696 | class ArrayLike: |
| 9697 | __array_interface__ = iface |
| 9698 | |
| 9699 | arr = np.asarray(ArrayLike()) |
| 9700 | # Note, we currently set the base anyway, but we do an allocation |
| 9701 | # (because NumPy doesn't like NULL data pointers everywhere). |
| 9702 | assert arr.shape == iface["shape"] |
| 9703 | assert arr.dtype == np.dtype(iface["typestr"]) |
| 9704 | assert arr.base is not None |
| 9705 | assert arr.flags.owndata |
| 9706 | |
| 9707 | |
| 9708 | def test_interface_nullptr_size_check(): |