@@ -82,11 +82,11 @@ def test_clip_dtypes(dt1, dt2):
82
82
assert dpt .all (r == ar1 )
83
83
assert r .sycl_queue == ar1 .sycl_queue
84
84
else :
85
- with pytest .raises (TypeError ):
85
+ with pytest .raises (ValueError ):
86
86
dpt .clip (ar1 , ar2 , ar3 )
87
- with pytest .raises (TypeError ):
87
+ with pytest .raises (ValueError ):
88
88
dpt .clip (ar1 , min = ar3 , max = None )
89
- with pytest .raises (TypeError ):
89
+ with pytest .raises (ValueError ):
90
90
dpt .clip (ar1 , min = None , max = ar3 )
91
91
92
92
@@ -217,19 +217,15 @@ def test_clip_out_need_temporary_none():
217
217
assert dpt .all (a_min [:- 6 ] == 2 ) and dpt .all (a_min [- 6 :] == 3 )
218
218
219
219
220
- def test_where_arg_validation ():
220
+ def test_clip_arg_validation ():
221
221
get_queue_or_skip ()
222
222
223
223
check = dict ()
224
224
x1 = dpt .empty ((1 ,), dtype = "i4" )
225
225
x2 = dpt .empty ((1 ,), dtype = "i4" )
226
226
227
227
with pytest .raises (TypeError ):
228
- dpt .where (check , x1 , x2 )
229
- with pytest .raises (TypeError ):
230
- dpt .where (x1 , check , x2 )
231
- with pytest .raises (TypeError ):
232
- dpt .where (x1 , x2 , check )
228
+ dpt .clip (check , x1 , x2 )
233
229
234
230
235
231
@pytest .mark .parametrize (
@@ -381,7 +377,7 @@ def test_clip_dtype_error():
381
377
ar4 = dpt .empty_like (ar1 , dtype = "f4" )
382
378
383
379
assert_raises_regex (
384
- TypeError ,
380
+ ValueError ,
385
381
"Output array of type.*is needed" ,
386
382
dpt .clip ,
387
383
ar1 ,
@@ -390,7 +386,7 @@ def test_clip_dtype_error():
390
386
ar4 ,
391
387
)
392
388
assert_raises_regex (
393
- TypeError ,
389
+ ValueError ,
394
390
"Output array of type.*is needed" ,
395
391
dpt .clip ,
396
392
ar1 ,
@@ -550,7 +546,7 @@ def test_clip_out_type_check():
550
546
out = range (10 )
551
547
552
548
with pytest .raises (TypeError ):
553
- dpt .add (x1 , x2 , x3 , out = out )
549
+ dpt .clip (x1 , x2 , x3 , out = out )
554
550
555
551
556
552
@pytest .mark .parametrize ("dt" , ["i4" , "f4" , "c8" ])
@@ -614,7 +610,7 @@ def test_clip_minmax_weak_types():
614
610
y = dpt .clip (x , min_v , max_v )
615
611
assert isinstance (y , dpt .usm_ndarray )
616
612
else :
617
- with pytest .raises (TypeError ):
613
+ with pytest .raises (ValueError ):
618
614
dpt .clip (x , min_v , max_v )
619
615
620
616
@@ -624,8 +620,8 @@ def test_clip_max_weak_types():
624
620
x = dpt .zeros (10 , dtype = "i4" )
625
621
m = dpt .ones (10 , dtype = "i4" )
626
622
627
- with pytest .raises (TypeError ):
623
+ with pytest .raises (ValueError ):
628
624
dpt .clip (x , m , 2.5 )
629
625
630
- with pytest .raises (TypeError ):
626
+ with pytest .raises (ValueError ):
631
627
dpt .clip (x , 2.5 , m )
0 commit comments