array-api-tests
array-api-tests copied to clipboard
asarray() copy flag and buffer protocol inputs are not sufficiently tested
The asarray test seems to only test the copy flag for array inputs. But it should also work for Python built-in (scalar or sequence) and buffer protocol inputs. copy=False should always error for Python built-ins, and it should always work for buffer protocol.
Actually, buffer protocol inputs for asarray
don't seem to be tested either. A simple way to test this would be to use array
objects from the Python standard library array module (as confusing as that is). Or we could use the new Python buffer types, but those are Python 3.12-only.
See also https://github.com/data-apis/array-api-strict/pull/15