@@ -577,15 +577,25 @@ def test_integers(self):
577
577
result = lib .infer_dtype (arr , skipna = True )
578
578
assert result == "integer"
579
579
580
- @pytest .mark .parametrize ("skipna" , [True , False ])
581
- def test_integer_na (self , skipna ):
580
+ @pytest .mark .parametrize (
581
+ "arr, skipna, expected" ,
582
+ [
583
+ (np .array ([1 , 2 , np .nan , np .nan , 3 ], dtype = "O" ), False , "integer-na" ),
584
+ (np .array ([1 , 2 , np .nan , np .nan , 3 ], dtype = "O" ), True , "integer" ),
585
+ (
586
+ np .array ([1 , 2 , 3 , np .int64 (4 ), np .int32 (5 ), np .nan ], dtype = "O" ),
587
+ False ,
588
+ "integer-na" ,
589
+ ),
590
+ (
591
+ np .array ([1 , 2 , 3 , np .int64 (4 ), np .int32 (5 ), np .nan ], dtype = "O" ),
592
+ True ,
593
+ "integer" ,
594
+ ),
595
+ ],
596
+ )
597
+ def test_integer_na (self , arr , skipna , expected ):
582
598
# GH 27392
583
- expected = "integer" if skipna else "integer-na"
584
- arr = np .array ([1 , 2 , np .nan , np .nan , 3 ], dtype = "O" )
585
- result = lib .infer_dtype (arr , skipna = skipna )
586
- assert result == expected
587
-
588
- arr = np .array ([1 , 2 , 3 , np .int64 (4 ), np .int32 (5 ), np .nan ], dtype = "O" )
589
599
result = lib .infer_dtype (arr , skipna = skipna )
590
600
assert result == expected
591
601
0 commit comments