Skip to content

Commit c995da4

Browse files
Use fallback on numpy for TestChoose
1 parent 58fba44 commit c995da4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

dpnp/tests/third_party/cupy/indexing_tests/test_indexing.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,34 +206,39 @@ def test_choose(self, xp, dtype):
206206
c = testing.shaped_arange((3, 4), xp, dtype)
207207
return a.choose(c)
208208

209+
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
209210
@testing.for_all_dtypes()
210211
@testing.numpy_cupy_array_equal()
211212
def test_choose_broadcast(self, xp, dtype):
212213
a = xp.array([[1, 0, 1], [0, 1, 0], [1, 0, 1]])
213214
c = xp.array([-10, 10]).astype(dtype)
214215
return a.choose(c)
215216

217+
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
216218
@testing.for_all_dtypes()
217219
@testing.numpy_cupy_array_equal()
218220
def test_choose_broadcast2(self, xp, dtype):
219221
a = xp.array([0, 1])
220222
c = testing.shaped_arange((3, 5, 2), xp, dtype)
221223
return a.choose(c)
222224

225+
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
223226
@testing.for_all_dtypes()
224227
@testing.numpy_cupy_array_equal()
225228
def test_choose_wrap(self, xp, dtype):
226229
a = xp.array([0, 3, -1, 5])
227230
c = testing.shaped_arange((3, 4), xp, dtype)
228231
return a.choose(c, mode="wrap")
229232

233+
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
230234
@testing.for_all_dtypes()
231235
@testing.numpy_cupy_array_equal()
232236
def test_choose_clip(self, xp, dtype):
233237
a = xp.array([0, 3, -1, 5])
234238
c = testing.shaped_arange((3, 4), xp, dtype)
235239
return a.choose(c, mode="clip")
236240

241+
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
237242
@testing.with_requires("numpy>=1.19")
238243
def test_unknown_clip(self):
239244
for xp in (numpy, cupy):
@@ -242,12 +247,14 @@ def test_unknown_clip(self):
242247
with pytest.raises(ValueError):
243248
a.choose(c, mode="unknown")
244249

250+
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
245251
def test_raise(self):
246252
a = cupy.array([2])
247253
c = cupy.array([[0, 1]])
248254
with self.assertRaises(ValueError):
249255
a.choose(c)
250256

257+
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
251258
@testing.for_all_dtypes()
252259
def test_choose_broadcast_fail(self, dtype):
253260
for xp in (numpy, cupy):

0 commit comments

Comments
 (0)