@@ -94,19 +94,20 @@ class TestElementwiseType(unittest.TestCase):
9494 @testing .for_int_dtypes (no_bool = True )
9595 @testing .numpy_cupy_array_equal (accept_error = OverflowError )
9696 def test_large_int_upper_1 (self , xp , dtype ):
97- a = xp .array ([0 ], dtype = xp .int8 )
97+ a = xp .array ([0 ], dtype = numpy .int8 )
9898 b = xp .iinfo (dtype ).max
9999 return a + b
100100
101101 @testing .for_int_dtypes (no_bool = True )
102102 @testing .numpy_cupy_array_equal (accept_error = OverflowError )
103103 def test_large_int_upper_2 (self , xp , dtype ):
104- flag = dtype in [numpy .int16 , numpy .int32 , numpy .int64 , numpy .longlong ]
105- flag = numpy .issubdtype (dtype , numpy .unsignedinteger ) or flag
106- if flag and numpy .lib .NumpyVersion (numpy .__version__ ) < "2.0.0" :
104+ if (
105+ numpy .issubdtype (dtype , numpy .unsignedinteger )
106+ and numpy .lib .NumpyVersion (numpy .__version__ ) < "2.0.0"
107+ ):
107108 pytest .skip ("numpy promotes dtype differently" )
108109
109- a = xp .array ([1 ], dtype = xp .int8 )
110+ a = xp .array ([1 ], dtype = numpy .int8 )
110111 b = xp .iinfo (dtype ).max - 1
111112 return a + b
112113
@@ -149,26 +150,14 @@ def test_large_int_upper_4(self, xp, dtype):
149150 @testing .for_int_dtypes (no_bool = True )
150151 @testing .numpy_cupy_array_equal (accept_error = OverflowError )
151152 def test_large_int_lower_1 (self , xp , dtype ):
152- if (
153- dtype in [numpy .int16 , numpy .int32 , numpy .int64 , numpy .longlong ]
154- and numpy .lib .NumpyVersion (numpy .__version__ ) < "2.0.0"
155- ):
156- pytest .skip ("numpy promotes dtype differently" )
157-
158- a = xp .array ([0 ], dtype = xp .int8 )
153+ a = xp .array ([0 ], dtype = numpy .int8 )
159154 b = xp .iinfo (dtype ).min
160155 return a + b
161156
162157 @testing .for_int_dtypes (no_bool = True )
163158 @testing .numpy_cupy_array_equal (accept_error = OverflowError )
164159 def test_large_int_lower_2 (self , xp , dtype ):
165- if (
166- dtype in [numpy .int16 , numpy .int32 , numpy .int64 , numpy .longlong ]
167- and numpy .lib .NumpyVersion (numpy .__version__ ) < "2.0.0"
168- ):
169- pytest .skip ("numpy promotes dtype differently" )
170-
171- a = xp .array ([- 1 ], dtype = xp .int8 )
160+ a = xp .array ([- 1 ], dtype = numpy .int8 )
172161 b = xp .iinfo (dtype ).min + 1
173162 return a + b
174163
0 commit comments