Skip to content

Commit 555adc2

Browse files
jschendeljreback
authored andcommitted
TST: Skip 32bit failing IntervalTree tests (#23442)
1 parent 6b9318c commit 555adc2

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

pandas/tests/indexes/interval/test_interval_tree.py

+17-4
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,28 @@
88
from pandas._libs.interval import IntervalTree
99

1010

11+
def skipif_32bit(param):
12+
"""
13+
Skip parameters in a parametrize on 32bit systems. Specifically used
14+
here to skip leaf_size parameters related to GH 23440.
15+
"""
16+
marks = pytest.mark.skipif(compat.is_platform_32bit(),
17+
reason='GH 23440: int type mismatch on 32bit')
18+
return pytest.param(param, marks=marks)
19+
20+
1121
@pytest.fixture(
1222
scope='class', params=['int32', 'int64', 'float32', 'float64', 'uint64'])
1323
def dtype(request):
1424
return request.param
1525

1626

17-
@pytest.fixture(params=[1, 2, 10])
27+
@pytest.fixture(params=[skipif_32bit(1), skipif_32bit(2), 10])
1828
def leaf_size(request):
29+
"""
30+
Fixture to specify IntervalTree leaf_size parameter; to be used with the
31+
tree fixture.
32+
"""
1933
return request.param
2034

2135

@@ -85,9 +99,8 @@ def test_get_loc_closed(self, closed):
8599
tm.assert_numpy_array_equal(tree.get_loc(p),
86100
np.array([0], dtype='int64'))
87101

88-
@pytest.mark.skipif(compat.is_platform_32bit(),
89-
reason="int type mismatch on 32bit")
90-
@pytest.mark.parametrize('leaf_size', [1, 10, 100, 10000])
102+
@pytest.mark.parametrize('leaf_size', [
103+
skipif_32bit(1), skipif_32bit(10), skipif_32bit(100), 10000])
91104
def test_get_indexer_closed(self, closed, leaf_size):
92105
x = np.arange(1000, dtype='float64')
93106
found = x.astype('intp')

0 commit comments

Comments
 (0)