Skip to content

Commit a166638

Browse files
jschendeljreback
authored andcommitted
TST: Add interval closed fixture to top-level conftest (#21595)
1 parent aa3e683 commit a166638

File tree

6 files changed

+9
-24
lines changed

6 files changed

+9
-24
lines changed

pandas/conftest.py

+8
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ def nselect_method(request):
137137
return request.param
138138

139139

140+
@pytest.fixture(params=['left', 'right', 'both', 'neither'])
141+
def closed(request):
142+
"""
143+
Fixture for trying all interval closed parameters
144+
"""
145+
return request.param
146+
147+
140148
@pytest.fixture(params=[None, np.nan, pd.NaT, float('nan'), np.float('NaN')])
141149
def nulls_fixture(request):
142150
"""

pandas/tests/indexes/interval/test_construction.py

-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
import pandas.util.testing as tm
1515

1616

17-
@pytest.fixture(params=['left', 'right', 'both', 'neither'])
18-
def closed(request):
19-
return request.param
20-
21-
2217
@pytest.fixture(params=[None, 'foo'])
2318
def name(request):
2419
return request.param

pandas/tests/indexes/interval/test_interval.py

-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212
import pandas as pd
1313

1414

15-
@pytest.fixture(scope='class', params=['left', 'right', 'both', 'neither'])
16-
def closed(request):
17-
return request.param
18-
19-
2015
@pytest.fixture(scope='class', params=[None, 'foo'])
2116
def name(request):
2217
return request.param

pandas/tests/indexes/interval/test_interval_range.py

-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
import pandas.util.testing as tm
1212

1313

14-
@pytest.fixture(scope='class', params=['left', 'right', 'both', 'neither'])
15-
def closed(request):
16-
return request.param
17-
18-
1914
@pytest.fixture(scope='class', params=[None, 'foo'])
2015
def name(request):
2116
return request.param

pandas/tests/indexes/interval/test_interval_tree.py

-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
import pandas.util.testing as tm
88

99

10-
@pytest.fixture(scope='class', params=['left', 'right', 'both', 'neither'])
11-
def closed(request):
12-
return request.param
13-
14-
1510
@pytest.fixture(
1611
scope='class', params=['int32', 'int64', 'float32', 'float64', 'uint64'])
1712
def dtype(request):

pandas/tests/indexing/interval/test_interval.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import pandas as pd
44

55
from pandas import Series, DataFrame, IntervalIndex, Interval
6-
from pandas.compat import product
76
import pandas.util.testing as tm
87

98

@@ -51,9 +50,7 @@ def test_getitem_with_scalar(self):
5150
tm.assert_series_equal(expected, s[s >= 2])
5251

5352
# TODO: check this behavior is consistent with test_interval_new.py
54-
@pytest.mark.parametrize('direction, closed',
55-
product(('increasing', 'decreasing'),
56-
('left', 'right', 'neither', 'both')))
53+
@pytest.mark.parametrize('direction', ['increasing', 'decreasing'])
5754
def test_nonoverlapping_monotonic(self, direction, closed):
5855
tpls = [(0, 1), (2, 3), (4, 5)]
5956
if direction == 'decreasing':

0 commit comments

Comments
 (0)