Skip to content

Commit ea53a82

Browse files
committed
update for non-using_infer_string
1 parent 6c4f078 commit ea53a82

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pandas/tests/arrays/categorical/test_constructors.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,10 @@ def test_categorical_preserve_object_dtype_from_pandas(self, using_infer_string)
827827
assert cat_from_ser.categories.dtype == object
828828
assert cat_from_idx.categories.dtype == object
829829

830-
# Numpy array or list: infer string dtype
831-
assert cat_from_arr.categories.dtype == "str"
832-
assert cat_from_list.categories.dtype == "str"
830+
if using_infer_string:
831+
# Numpy array or list: infer string dtype
832+
assert cat_from_arr.categories.dtype == "str"
833+
assert cat_from_list.categories.dtype == "str"
834+
else:
835+
assert cat_from_arr.categories.dtype == object
836+
assert cat_from_list.categories.dtype == object

0 commit comments

Comments
 (0)