diff --git a/pandas/tests/strings/test_split_partition.py b/pandas/tests/strings/test_split_partition.py index cbe4f950494be..74458c13e8df7 100644 --- a/pandas/tests/strings/test_split_partition.py +++ b/pandas/tests/strings/test_split_partition.py @@ -434,10 +434,10 @@ def test_split_with_name_index(): ], ], ) -def test_partition_series_more_than_one_char(method, exp): +def test_partition_series_more_than_one_char(method, exp, any_string_dtype): # https://github.com/pandas-dev/pandas/issues/23558 # more than one char - s = Series(["a__b__c", "c__d__e", np.nan, "f__g__h", None]) + s = Series(["a__b__c", "c__d__e", np.nan, "f__g__h", None], dtype=any_string_dtype) result = getattr(s.str, method)("__", expand=False) expected = Series(exp) tm.assert_series_equal(result, expected)