Skip to content

Commit 8e35f2e

Browse files
committed
Fix the less() meta-test to actually test all dtype combinations
1 parent c0ec0bb commit 8e35f2e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

meta_tests/test_array_helpers.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from hypothesis import given
2+
from hypothesis import strategies as st
23

34
from array_api_tests import _array_module as xp
4-
from array_api_tests.hypothesis_helpers import two_mutual_arrays
5-
from array_api_tests.dtype_helpers import int_dtypes
5+
from array_api_tests.hypothesis_helpers import (int_dtypes, arrays,
6+
two_mutually_broadcastable_shapes)
67
from array_api_tests.shape_helpers import iter_indices, broadcast_shapes
78
from array_api_tests .array_helpers import exactly_equal, notequal, less
89

@@ -23,8 +24,11 @@ def test_notequal():
2324
assert xp.all(xp.equal(notequal(a, b), res))
2425

2526

26-
@given(*two_mutual_arrays(dtypes=int_dtypes))
27-
def test_less(x, y):
27+
@given(two_mutually_broadcastable_shapes, int_dtypes, int_dtypes, st.data())
28+
def test_less(shapes, dtype1, dtype2, data):
29+
x = data.draw(arrays(shape=shapes[0], dtype=dtype1))
30+
y = data.draw(arrays(shape=shapes[1], dtype=dtype2))
31+
2832
res = less(x, y)
2933

3034
for i, j, k in iter_indices(x.shape, y.shape, broadcast_shapes(x.shape, y.shape)):

0 commit comments

Comments
 (0)