|
8 | 8 | from pandas._libs.interval import IntervalTree
|
9 | 9 |
|
10 | 10 |
|
| 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 | + |
11 | 21 | @pytest.fixture(
|
12 | 22 | scope='class', params=['int32', 'int64', 'float32', 'float64', 'uint64'])
|
13 | 23 | def dtype(request):
|
14 | 24 | return request.param
|
15 | 25 |
|
16 | 26 |
|
17 |
| -@pytest.fixture(params=[1, 2, 10]) |
| 27 | +@pytest.fixture(params=[skipif_32bit(1), skipif_32bit(2), 10]) |
18 | 28 | def leaf_size(request):
|
| 29 | + """ |
| 30 | + Fixture to specify IntervalTree leaf_size parameter; to be used with the |
| 31 | + tree fixture. |
| 32 | + """ |
19 | 33 | return request.param
|
20 | 34 |
|
21 | 35 |
|
@@ -85,9 +99,8 @@ def test_get_loc_closed(self, closed):
|
85 | 99 | tm.assert_numpy_array_equal(tree.get_loc(p),
|
86 | 100 | np.array([0], dtype='int64'))
|
87 | 101 |
|
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]) |
91 | 104 | def test_get_indexer_closed(self, closed, leaf_size):
|
92 | 105 | x = np.arange(1000, dtype='float64')
|
93 | 106 | found = x.astype('intp')
|
|
0 commit comments