Skip to content

Commit cfed693

Browse files
author
Jiang Yue
committed
parameterization of tests
1 parent 78c105d commit cfed693

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

pandas/tests/dtypes/test_inference.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -577,16 +577,19 @@ def test_integers(self):
577577
result = lib.infer_dtype(arr, skipna=True)
578578
assert result == "integer"
579579

580-
@pytest.mark.parametrize("skipna", [True, False])
581-
def test_integer_na(self, skipna):
580+
@pytest.mark.parametrize(
581+
"arr, skipna",
582+
[
583+
(np.array([1, 2, np.nan, np.nan, 3], dtype="O"), False),
584+
(np.array([1, 2, np.nan, np.nan, 3], dtype="O"), True),
585+
(np.array([1, 2, 3, np.int64(4), np.int32(5), np.nan], dtype="O"), False),
586+
(np.array([1, 2, 3, np.int64(4), np.int32(5), np.nan], dtype="O"), True),
587+
],
588+
)
589+
def test_integer_na(self, arr, skipna, expected):
582590
# 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")
589591
result = lib.infer_dtype(arr, skipna=skipna)
592+
expected = "integer" if skipna else "integer-na"
590593
assert result == expected
591594

592595
def test_deprecation(self):

0 commit comments

Comments
 (0)