@@ -82,11 +82,11 @@ def test_clip_dtypes(dt1, dt2):
8282 assert dpt .all (r == ar1 )
8383 assert r .sycl_queue == ar1 .sycl_queue
8484 else :
85- with pytest .raises (TypeError ):
85+ with pytest .raises (ValueError ):
8686 dpt .clip (ar1 , ar2 , ar3 )
87- with pytest .raises (TypeError ):
87+ with pytest .raises (ValueError ):
8888 dpt .clip (ar1 , min = ar3 , max = None )
89- with pytest .raises (TypeError ):
89+ with pytest .raises (ValueError ):
9090 dpt .clip (ar1 , min = None , max = ar3 )
9191
9292
@@ -217,19 +217,15 @@ def test_clip_out_need_temporary_none():
217217 assert dpt .all (a_min [:- 6 ] == 2 ) and dpt .all (a_min [- 6 :] == 3 )
218218
219219
220- def test_where_arg_validation ():
220+ def test_clip_arg_validation ():
221221 get_queue_or_skip ()
222222
223223 check = dict ()
224224 x1 = dpt .empty ((1 ,), dtype = "i4" )
225225 x2 = dpt .empty ((1 ,), dtype = "i4" )
226226
227227 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 )
233229
234230
235231@pytest .mark .parametrize (
@@ -381,7 +377,7 @@ def test_clip_dtype_error():
381377 ar4 = dpt .empty_like (ar1 , dtype = "f4" )
382378
383379 assert_raises_regex (
384- TypeError ,
380+ ValueError ,
385381 "Output array of type.*is needed" ,
386382 dpt .clip ,
387383 ar1 ,
@@ -390,7 +386,7 @@ def test_clip_dtype_error():
390386 ar4 ,
391387 )
392388 assert_raises_regex (
393- TypeError ,
389+ ValueError ,
394390 "Output array of type.*is needed" ,
395391 dpt .clip ,
396392 ar1 ,
@@ -550,7 +546,7 @@ def test_clip_out_type_check():
550546 out = range (10 )
551547
552548 with pytest .raises (TypeError ):
553- dpt .add (x1 , x2 , x3 , out = out )
549+ dpt .clip (x1 , x2 , x3 , out = out )
554550
555551
556552@pytest .mark .parametrize ("dt" , ["i4" , "f4" , "c8" ])
@@ -614,7 +610,7 @@ def test_clip_minmax_weak_types():
614610 y = dpt .clip (x , min_v , max_v )
615611 assert isinstance (y , dpt .usm_ndarray )
616612 else :
617- with pytest .raises (TypeError ):
613+ with pytest .raises (ValueError ):
618614 dpt .clip (x , min_v , max_v )
619615
620616
@@ -624,8 +620,8 @@ def test_clip_max_weak_types():
624620 x = dpt .zeros (10 , dtype = "i4" )
625621 m = dpt .ones (10 , dtype = "i4" )
626622
627- with pytest .raises (TypeError ):
623+ with pytest .raises (ValueError ):
628624 dpt .clip (x , m , 2.5 )
629625
630- with pytest .raises (TypeError ):
626+ with pytest .raises (ValueError ):
631627 dpt .clip (x , 2.5 , m )
0 commit comments