@@ -305,16 +305,28 @@ def test_ddof_nans(func, dtype) -> None:
305
305
306
306
307
307
@pytest .mark .parametrize ("dtype" , DTYPES )
308
- @pytest .mark .parametrize ("func" , (bn .nanmean , bn .nanmax ), ids = lambda x : x .__name__ )
309
- def test_reduce_with_unordered_strides_ccontig (func , dtype ) -> None :
308
+ @pytest .mark .parametrize (
309
+ ("func" , "expected" ),
310
+ [(bn .nansum , 1000 ),
311
+ (bn .nanmean , 1 ),
312
+ (bn .nanmax , 1 )],
313
+ ids = lambda x : x .__name__ if not isinstance (x , int ) else x
314
+ )
315
+ def test_reduce_with_unordered_strides_ccontig (func , expected , dtype ) -> None :
310
316
array = np .ones ((1 , 500 , 2 ), dtype = dtype ).transpose ((1 ,2 ,0 ))
311
317
result = func (array )
312
- assert result == 1000
318
+ assert result == expected
313
319
314
320
@pytest .mark .parametrize ("dtype" , DTYPES )
315
- @pytest .mark .parametrize ("func" , (bn .nanmean , bn .nanmax ), ids = lambda x : x .__name__ )
316
- def test_reduce_with_unordered_strides_fcontig (func , dtype ) -> None :
321
+ @pytest .mark .parametrize (
322
+ ("func" , "expected" ),
323
+ [(bn .nansum , 1000 ),
324
+ (bn .nanmean , 1 ),
325
+ (bn .nanmax , 1 )],
326
+ ids = lambda x : x .__name__ if not isinstance (x , int ) else x
327
+ )
328
+ def test_reduce_with_unordered_strides_fcontig (func , expected , dtype ) -> None :
317
329
array = np .ones ((1 , 500 , 2 ), dtype = dtype ).transpose ((0 ,2 ,1 ))
318
330
result = func (array )
319
- assert result == 1000
331
+ assert result == expected
320
332
0 commit comments