@@ -268,7 +268,6 @@ def test_asarray_cross_library(source_library, target_library, request):
268268 assert b .dtype == tgt_lib .int32
269269
270270
271-
272271@pytest .mark .parametrize ("library" , wrapped_libraries )
273272def test_asarray_copy (library ):
274273 # Note, we have this test here because the test suite currently doesn't
@@ -323,21 +322,21 @@ def test_asarray_copy(library):
323322
324323 # Python built-in types
325324 for obj in [True , 0 , 0.0 , 0j , [0 ], [[0 ]]]:
326- asarray (obj , copy = True ) # No error
327- asarray (obj , copy = None ) # No error
325+ asarray (obj , copy = True ) # No error
326+ asarray (obj , copy = None ) # No error
328327
329328 with pytest .raises (ValueError ):
330329 asarray (obj , copy = False )
331330
332331 # Use the standard library array to test the buffer protocol
333- a = array .array ('f' , [1.0 ])
332+ a = array .array ("f" , [1.0 ])
334333 b = asarray (a , copy = True )
335334 assert is_lib_func (b )
336335 a [0 ] = 0.0
337336 assert b [0 ] == 1.0
338337
339- a = array .array ('f' , [1.0 ])
340- if library in (' cupy' , ' dask.array' ):
338+ a = array .array ("f" , [1.0 ])
339+ if library in (" cupy" , " dask.array" ):
341340 with pytest .raises (ValueError ):
342341 asarray (a , copy = False )
343342 else :
@@ -346,11 +345,11 @@ def test_asarray_copy(library):
346345 a [0 ] = 0.0
347346 assert b [0 ] == 0.0
348347
349- a = array .array ('f' , [1.0 ])
348+ a = array .array ("f" , [1.0 ])
350349 b = asarray (a , copy = None )
351350 assert is_lib_func (b )
352351 a [0 ] = 0.0
353- if library in (' cupy' , ' dask.array' ):
352+ if library in (" cupy" , " dask.array" ):
354353 # A copy is required for libraries where the default device is not CPU
355354 # dask changed behaviour of copy=None in 2024.12 to copy;
356355 # this wrapper ensures the same behaviour in older versions too.
0 commit comments