Skip to content

Commit 1e646a3

Browse files
fix test + explicitly test default
1 parent acd303e commit 1e646a3

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

pandas/tests/arrays/string_/test_string_arrow.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ def test_eq_all_na():
2626
tm.assert_extension_array_equal(result, expected)
2727

2828

29-
def test_config(string_storage, request, using_infer_string):
29+
def test_config(string_storage, using_infer_string):
30+
# with the default string_storage setting
31+
# always "python" at the moment
32+
assert StringDtype().storage == "python"
33+
3034
with pd.option_context("string_storage", string_storage):
3135
assert StringDtype().storage == string_storage
3236
result = pd.array(["a", "b"])

pandas/tests/dtypes/test_common.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import numpy as np
44
import pytest
55

6+
from pandas.compat import HAS_PYARROW
67
import pandas.util._test_decorators as td
78

89
from pandas.core.dtypes.astype import astype_array
@@ -802,13 +803,17 @@ def test_pandas_dtype_ea_not_instance():
802803

803804

804805
def test_pandas_dtype_string_dtypes(string_storage):
805-
# TODO(infer_string) remove skip if "python" is supported
806-
pytest.importorskip("pyarrow")
806+
with pd.option_context("future.infer_string", True):
807+
# with the default string_storage setting
808+
result = pandas_dtype("str")
809+
assert result == pd.StringDtype(
810+
"pyarrow" if HAS_PYARROW else "python", na_value=np.nan
811+
)
812+
807813
with pd.option_context("future.infer_string", True):
808814
with pd.option_context("string_storage", string_storage):
809815
result = pandas_dtype("str")
810-
# TODO(infer_string) hardcoded to pyarrow until python is supported
811-
assert result == pd.StringDtype("pyarrow", na_value=np.nan)
816+
assert result == pd.StringDtype(string_storage, na_value=np.nan)
812817

813818
with pd.option_context("future.infer_string", False):
814819
with pd.option_context("string_storage", string_storage):

0 commit comments

Comments
 (0)