@@ -126,12 +126,13 @@ def test_clip_max_none(self, xp, dtype):
126
126
a = testing .shaped_arange ((2 , 3 , 4 ), xp , dtype )
127
127
return a .clip (3 , None )
128
128
129
+ # numpy>=2.0 does not raise ValueError with a_min=None, a_max=None
130
+ @testing .with_requires ("numpy>=2.0" )
129
131
@testing .for_all_dtypes (no_bool = True , no_complex = True )
130
132
def test_clip_min_max_none (self , dtype ):
131
133
for xp in (numpy , cupy ):
132
134
a = testing .shaped_arange ((2 , 3 , 4 ), xp , dtype )
133
- with pytest .raises (ValueError ):
134
- a .clip (None , None )
135
+ return a .clip (None , None )
135
136
136
137
@testing .for_all_dtypes (no_complex = True )
137
138
@testing .numpy_cupy_array_equal ()
@@ -155,8 +156,15 @@ def test_external_clip3(self, xp, dtype):
155
156
def test_external_clip4 (self , dtype ):
156
157
for xp in (numpy , cupy ):
157
158
a = testing .shaped_arange ((2 , 3 , 4 ), xp , dtype )
158
- with pytest .raises (TypeError ):
159
- xp .clip (a , 3 )
159
+ # dpnp.clip() has default a_min, a_max variables as None
160
+ # while numpy.clip() uses np._NoValue(numpy>=2.0)
161
+ # or required arguments (numpy<2.0) for a_min, a_max
162
+ # and raises TypeError if passing a_min only
163
+ if xp is numpy :
164
+ with pytest .raises (TypeError ):
165
+ xp .clip (a , 3 )
166
+ else :
167
+ return xp .clip (a , 3 )
160
168
161
169
@testing .for_all_dtypes (no_complex = True )
162
170
@testing .numpy_cupy_array_equal ()
0 commit comments