Skip to content

Commit 8adb08d

Browse files
use string_storage fixture more
1 parent a6d066c commit 8adb08d

File tree

3 files changed

+9
-42
lines changed

3 files changed

+9
-42
lines changed

pandas/tests/arrays/string_/test_string.py

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,15 @@
1414
import pandas._testing as tm
1515
from pandas.core.arrays.string_arrow import ArrowStringArray
1616

17-
skip_if_no_pyarrow = td.skip_if_no("pyarrow", min_version="1.0.0")
1817

19-
20-
@pytest.fixture(
21-
params=[
22-
pd.StringDtype(storage="python"),
23-
pytest.param(
24-
pd.StringDtype(storage="pyarrow"),
25-
marks=skip_if_no_pyarrow,
26-
),
27-
]
28-
)
29-
def dtype(request):
30-
return request.param
18+
@pytest.fixture
19+
def dtype(string_storage):
20+
return pd.StringDtype(storage=string_storage)
3121

3222

33-
@pytest.fixture(
34-
params=[
35-
pd.arrays.StringArray,
36-
pytest.param(ArrowStringArray, marks=skip_if_no_pyarrow),
37-
]
38-
)
39-
def cls(request):
40-
return request.param
23+
@pytest.fixture
24+
def cls(dtype):
25+
return dtype.construct_array_type()
4126

4227

4328
def test_repr(dtype):

pandas/tests/extension/test_string.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
import numpy as np
1919
import pytest
2020

21-
import pandas.util._test_decorators as td
22-
2321
import pandas as pd
2422
from pandas.core.arrays.string_ import StringDtype
2523
from pandas.tests.extension import base
@@ -48,14 +46,9 @@ def chunked(request):
4846
return request.param
4947

5048

51-
@pytest.fixture(
52-
params=[
53-
"python",
54-
pytest.param("pyarrow", marks=td.skip_if_no("pyarrow", min_version="1.0.0")),
55-
]
56-
)
57-
def dtype(request):
58-
return StringDtype(storage=request.param)
49+
@pytest.fixture
50+
def dtype(string_storage):
51+
return StringDtype(storage=string_storage)
5952

6053

6154
@pytest.fixture

pandas/tests/frame/methods/test_convert_dtypes.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import numpy as np
22
import pytest
33

4-
import pandas.util._test_decorators as td
5-
64
import pandas as pd
75
import pandas._testing as tm
86

@@ -11,15 +9,6 @@ class TestConvertDtypes:
119
@pytest.mark.parametrize(
1210
"convert_integer, expected", [(False, np.dtype("int32")), (True, "Int32")]
1311
)
14-
@pytest.mark.parametrize(
15-
"string_storage",
16-
[
17-
"python",
18-
pytest.param(
19-
"pyarrow", marks=td.skip_if_no("pyarrow", min_version="1.0.0")
20-
),
21-
],
22-
)
2312
def test_convert_dtypes(self, convert_integer, expected, string_storage):
2413
# Specific types are tested in tests/series/test_dtypes.py
2514
# Just check that it works for DataFrame here

0 commit comments

Comments
 (0)