summaryrefslogtreecommitdiff
path: root/numpy/array_api/tests/test_creation_functions.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/array_api/tests/test_creation_functions.py')
-rw-r--r--numpy/array_api/tests/test_creation_functions.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/array_api/tests/test_creation_functions.py b/numpy/array_api/tests/test_creation_functions.py
index 7b633eaf1..ebbb6aab3 100644
--- a/numpy/array_api/tests/test_creation_functions.py
+++ b/numpy/array_api/tests/test_creation_functions.py
@@ -11,11 +11,13 @@ from .._creation_functions import (
full,
full_like,
linspace,
+ meshgrid,
ones,
ones_like,
zeros,
zeros_like,
)
+from .._dtypes import float32, float64
from .._array_object import Array
@@ -124,3 +126,11 @@ def test_zeros_like_errors():
assert_raises(ValueError, lambda: zeros_like(asarray(1), device="gpu"))
assert_raises(ValueError, lambda: zeros_like(asarray(1), dtype=int))
assert_raises(ValueError, lambda: zeros_like(asarray(1), dtype="i"))
+
+def test_meshgrid_dtype_errors():
+ # Doesn't raise
+ meshgrid()
+ meshgrid(asarray([1.], dtype=float32))
+ meshgrid(asarray([1.], dtype=float32), asarray([1.], dtype=float32))
+
+ assert_raises(ValueError, lambda: meshgrid(asarray([1.], dtype=float32), asarray([1.], dtype=float64)))