12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
+ import operator
16
+
15
17
import pandas
16
18
import pytest
17
19
18
20
21
+ @pytest .fixture (params = [True , False ])
22
+ def as_array (request ):
23
+ """
24
+ Boolean fixture to support ExtensionDtype _from_sequence method testing.
25
+
26
+ See:
27
+ https://github.com/pandas-dev/pandas/blob/main/pandas/tests/extension/conftest.py
28
+ """
29
+ return request .param
30
+
31
+
19
32
@pytest .fixture (params = [True , False ])
20
33
def as_frame (request ):
21
34
"""
@@ -38,6 +51,36 @@ def as_series(request):
38
51
return request .param
39
52
40
53
54
+ @pytest .fixture (params = [True , False ])
55
+ def box_in_series (request ):
56
+ """
57
+ Whether to box the data in a Series
58
+
59
+ See:
60
+ https://github.com/pandas-dev/pandas/blob/main/pandas/tests/extension/conftest.py
61
+ """
62
+ return request .param
63
+
64
+
65
+ @pytest .fixture (
66
+ params = [
67
+ operator .eq ,
68
+ operator .ne ,
69
+ operator .gt ,
70
+ operator .ge ,
71
+ operator .lt ,
72
+ operator .le ,
73
+ ]
74
+ )
75
+ def comparison_op (request ):
76
+ """
77
+ Fixture for operator module comparison functions.
78
+
79
+ See: https://github.com/pandas-dev/pandas/blob/main/pandas/conftest.py
80
+ """
81
+ return request .param
82
+
83
+
41
84
@pytest .fixture (params = ["ffill" , "bfill" ])
42
85
def fillna_method (request ):
43
86
"""
@@ -50,6 +93,25 @@ def fillna_method(request):
50
93
return request .param
51
94
52
95
96
+ @pytest .fixture (
97
+ params = [
98
+ lambda x : 1 ,
99
+ lambda x : [1 ] * len (x ),
100
+ lambda x : pandas .Series ([1 ] * len (x )),
101
+ lambda x : x ,
102
+ ],
103
+ ids = ["scalar" , "list" , "series" , "object" ],
104
+ )
105
+ def groupby_apply_op (request ):
106
+ """
107
+ Functions to test groupby.apply().
108
+
109
+ See:
110
+ https://github.com/pandas-dev/pandas/blob/main/pandas/tests/extension/conftest.py
111
+ """
112
+ return request .param
113
+
114
+
53
115
@pytest .fixture
54
116
def invalid_scalar (data ):
55
117
"""
0 commit comments