Skip to content

Commit 5c82abf

Browse files
committed
Corrected test_argsort_ndarray test with unique generated random values
1 parent 8c97a8d commit 5c82abf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test_sort.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ def test_argsort_axis(self, axis):
4747
@pytest.mark.parametrize("dtype", get_all_dtypes())
4848
@pytest.mark.parametrize("axis", [None, -2, -1, 0, 1])
4949
def test_argsort_ndarray(self, dtype, axis):
50-
a = numpy.random.uniform(-10, 10, 12)
50+
if dtype and issubclass(dtype, numpy.integer):
51+
a = numpy.random.choice(
52+
numpy.arange(-10, 10), replace=False, size=12
53+
)
54+
else:
55+
a = numpy.random.uniform(-10, 10, 12)
5156
np_array = numpy.array(a, dtype=dtype).reshape(6, 2)
5257
dp_array = dpnp.array(np_array)
5358

0 commit comments

Comments
 (0)