@@ -139,23 +139,23 @@ def test_asarray_copy(library):
139139 b = asarray (a , copy = True )
140140 assert is_lib_func (b )
141141 a [0 ] = 0
142- assert all (b [ 0 ] == 1 )
143- assert all (a [ 0 ] == 0 )
142+ assert all (b == 1 )
143+ assert all (a == 0 )
144144
145145 a = asarray ([1 ])
146146 b = asarray (a , copy = True , dtype = a .dtype )
147147 assert is_lib_func (b )
148148 a [0 ] = 0
149- assert all (b [ 0 ] == 1 )
150- assert all (a [ 0 ] == 0 )
149+ assert all (b == 1 )
150+ assert all (a == 0 )
151151
152152 # Tests for copy=False
153153 a = asarray ([1 ])
154154 if supports_copy_false :
155155 b = asarray (a , copy = False )
156156 assert is_lib_func (b )
157157 a [0 ] = 0
158- assert all (b [ 0 ] == 0 )
158+ assert all (b == 0 )
159159 else :
160160 with pytest .raises (NotImplementedError ):
161161 asarray (a , copy = False )
@@ -176,7 +176,7 @@ def test_asarray_copy(library):
176176 b = asarray (a , copy = None )
177177 assert is_lib_func (b )
178178 a [0 ] = 0
179- assert all ((b [ 0 ] == 1.0 ) | (b [ 0 ] == 0.0 ))
179+ assert all ((b == 1.0 ) | (b == 0.0 ))
180180
181181 a = asarray ([1.0 ], dtype = xp .float32 )
182182 assert a .dtype == xp .float32
@@ -185,15 +185,15 @@ def test_asarray_copy(library):
185185 assert b .dtype == xp .float64
186186 a [0 ] = 0.0
187187 # dtype change must always trigger a copy
188- assert all (b [ 0 ] == 1.0 )
188+ assert all (b == 1.0 )
189189
190190 a = asarray ([1.0 ], dtype = xp .float64 )
191191 assert a .dtype == xp .float64
192192 b = asarray (a , dtype = xp .float64 , copy = None )
193193 assert is_lib_func (b )
194194 assert b .dtype == xp .float64
195195 a [0 ] = 0.0
196- assert all ((b [ 0 ] == 1.0 ) | (b [ 0 ] == 0.0 ))
196+ assert all ((b == 1.0 ) | (b == 0.0 ))
197197
198198 # Python built-in types
199199 for obj in [True , 0 , 0.0 , 0j , [0 ], [[0 ]]]:
@@ -211,14 +211,14 @@ def test_asarray_copy(library):
211211 b = asarray (a , copy = True )
212212 assert is_lib_func (b )
213213 a [0 ] = 0.0
214- assert all (b [ 0 ] == 1.0 )
214+ assert all (b == 1.0 )
215215
216216 a = array .array ('f' , [1.0 ])
217217 if supports_copy_false :
218218 b = asarray (a , copy = False )
219219 assert is_lib_func (b )
220220 a [0 ] = 0.0
221- assert all (b [ 0 ] == 0.0 )
221+ assert all (b == 0.0 )
222222 else :
223223 with pytest .raises (NotImplementedError ):
224224 asarray (a , copy = False )
@@ -227,4 +227,4 @@ def test_asarray_copy(library):
227227 b = asarray (a , copy = None )
228228 assert is_lib_func (b )
229229 a [0 ] = 0.0
230- assert all ((b [ 0 ] == 1.0 ) | (b [ 0 ] == 0.0 ))
230+ assert all ((b == 1.0 ) | (b == 0.0 ))
0 commit comments