Skip to content

Commit 7c00c66

Browse files
committed
paramterize test
1 parent 0b29d82 commit 7c00c66

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

pandas/tests/series/methods/test_convert_dtypes.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -300,17 +300,13 @@ def test_convert_dtypes_pyarrow_null(self):
300300
tm.assert_series_equal(result, expected)
301301

302302
@td.skip_if_no("pyarrow")
303-
def test_convert_empty_categorical_to_pyarrow(self):
303+
@pytest.mark.parametrize("categories", [None, ["S1", "S2"]])
304+
def test_convert_empty_categorical_to_pyarrow(self, categories):
304305
# GH#59934
305-
ser1 = pd.Series(pd.Categorical([None] * 5))
306-
converted1 = ser1.convert_dtypes(dtype_backend="pyarrow")
307-
expected = ser1
308-
tm.assert_series_equal(converted1, expected)
309-
310-
ser2 = pd.Series(pd.Categorical([None] * 5, categories=["S1", "S2"]))
311-
converted2 = ser2.convert_dtypes(dtype_backend="pyarrow")
312-
expected = ser2
313-
tm.assert_series_equal(converted2, expected)
306+
ser = pd.Series(pd.Categorical([None] * 5, categories=categories))
307+
converted = ser.convert_dtypes(dtype_backend="pyarrow")
308+
expected = ser
309+
tm.assert_series_equal(converted, expected)
314310

315311
def test_convert_dtype_pyarrow_timezone_preserve(self):
316312
# GH 60237

0 commit comments

Comments
 (0)