Skip to content

Commit 4cccc26

Browse files
committed
Use the promote_dtypes helper instead of _array_module.result_type
1 parent 720832f commit 4cccc26

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

array_api_tests/test_linalg.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from hypothesis.strategies import booleans, composite, none, integers, shared
1818

1919
from .array_helpers import (assert_exactly_equal, ndindex, asarray,
20-
numeric_dtype_objects)
20+
numeric_dtype_objects, promote_dtypes)
2121
from .hypothesis_helpers import (xps, dtypes, shapes, kwargs, matrix_shapes,
2222
square_matrix_shapes, symmetric_matrices,
2323
positive_definite_matrices, MAX_ARRAY_SIZE,
@@ -132,8 +132,7 @@ def test_cross(x1_x2_kw):
132132

133133
res = linalg.cross(x1, x2, **kw)
134134

135-
# TODO: Replace result_type() with a helper function
136-
assert res.dtype == _array_module.result_type(x1, x2), "cross() did not return the correct dtype"
135+
assert res.dtype == promote_dtypes(x1, x2), "cross() did not return the correct dtype"
137136
assert res.shape == shape, "cross() did not return the correct shape"
138137

139138
# cross is too different from other functions to use _test_stacks, and it
@@ -269,8 +268,7 @@ def test_matmul(x1, x2):
269268
else:
270269
res = linalg.matmul(x1, x2)
271270

272-
# TODO: Replace result_type() with a helper function
273-
assert res.dtype == _array_module.result_type(x1, x2), "matmul() did not return the correct dtype"
271+
assert res.dtype == promote_dtypes(x1, x2), "matmul() did not return the correct dtype"
274272

275273
if len(x1.shape) == len(x2.shape) == 1:
276274
assert res.shape == ()

0 commit comments

Comments
 (0)