Skip to content

Commit f38020f

Browse files
jbrockmendeljreback
authored andcommitted
TST: parametrize sparse array arithmetic tests (#27271)
1 parent dc5a848 commit f38020f

File tree

2 files changed

+249
-253
lines changed

2 files changed

+249
-253
lines changed

pandas/conftest.py

+30
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from datetime import date, time, timedelta, timezone
22
from decimal import Decimal
3+
import operator
34
import os
45

56
from dateutil.tz import tzlocal, tzutc
@@ -13,6 +14,7 @@
1314

1415
import pandas as pd
1516
from pandas import DataFrame
17+
from pandas.core import ops
1618
import pandas.util.testing as tm
1719

1820
hypothesis.settings.register_profile(
@@ -163,6 +165,34 @@ def all_arithmetic_operators(request):
163165
return request.param
164166

165167

168+
@pytest.fixture(
169+
params=[
170+
operator.add,
171+
ops.radd,
172+
operator.sub,
173+
ops.rsub,
174+
operator.mul,
175+
ops.rmul,
176+
operator.truediv,
177+
ops.rtruediv,
178+
operator.floordiv,
179+
ops.rfloordiv,
180+
operator.mod,
181+
ops.rmod,
182+
operator.pow,
183+
ops.rpow,
184+
]
185+
)
186+
def all_arithmetic_functions(request):
187+
"""
188+
Fixture for operator and roperator arithmetic functions.
189+
190+
Note: This includes divmod and rdivmod, whereas all_arithmetic_operators
191+
does not.
192+
"""
193+
return request.param
194+
195+
166196
_all_numeric_reductions = [
167197
"sum",
168198
"max",

0 commit comments

Comments
 (0)