Skip to content

Commit 8a698f7

Browse files
Debian Science Teamrebecca-palmer
authored andcommitted
Fix test failures on 32-bit systems
Author: Rebecca N. Palmer <[email protected]> Bug-Debian: partly https://bugs.debian.org/1026351 Forwarded: no Gbp-Pq: Name tests_dont_assume_64bit.patch
1 parent 3b6ff8c commit 8a698f7

File tree

6 files changed

+18
-2
lines changed

6 files changed

+18
-2
lines changed

pandas/tests/frame/test_stack_unstack.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
)
2121
import pandas._testing as tm
2222
from pandas.core.reshape import reshape as reshape_lib
23+
from pandas.compat import IS64
2324

2425

2526
@pytest.fixture(params=[True, False])
@@ -2175,6 +2176,7 @@ def test_unstack_unobserved_keys(self, future_stack):
21752176
tm.assert_frame_equal(recons, df)
21762177

21772178
@pytest.mark.slow
2179+
@pytest.mark.xfail(condition=not IS64, reason="assumes default int is int64")
21782180
def test_unstack_number_of_levels_larger_than_int32(self, monkeypatch):
21792181
# GH#20601
21802182
# GH 26314: Change ValueError to PerformanceWarning

pandas/tests/groupby/test_groupby.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import numpy as np
77
import pytest
88

9+
from pandas.compat import IS64
910
from pandas.errors import (
1011
PerformanceWarning,
1112
SpecificationError,
@@ -2618,6 +2619,7 @@ def test_groupby_series_with_tuple_name():
26182619
tm.assert_series_equal(result, expected)
26192620

26202621

2622+
@pytest.mark.xfail(not IS64, reason="GH#38778: fail on 32-bit system", strict=False)
26212623
@pytest.mark.parametrize(
26222624
"func, values", [("sum", [97.0, 98.0]), ("mean", [24.25, 24.5])]
26232625
)
@@ -2630,6 +2632,7 @@ def test_groupby_numerical_stability_sum_mean(func, values):
26302632
tm.assert_frame_equal(result, expected)
26312633

26322634

2635+
@pytest.mark.xfail(not IS64, reason="GH#38778: fail on 32-bit system", strict=False)
26332636
def test_groupby_numerical_stability_cumsum():
26342637
# GH#38934
26352638
data = [1e16, 1e16, 97, 98, -5e15, -5e15, -5e15, -5e15]

pandas/tests/reshape/test_pivot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from pandas.api.types import CategoricalDtype
2929
from pandas.core.reshape import reshape as reshape_lib
3030
from pandas.core.reshape.pivot import pivot_table
31+
from pandas.compat import IS64
3132

3233

3334
@pytest.fixture(params=[True, False])
@@ -2092,6 +2093,7 @@ def test_pivot_string_func_vs_func(self, f, f_numpy, data):
20922093
tm.assert_frame_equal(result, expected)
20932094

20942095
@pytest.mark.slow
2096+
@pytest.mark.xfail(condition=not IS64, reason="assumes default int is int64")
20952097
def test_pivot_number_of_levels_larger_than_int32(self, monkeypatch):
20962098
# GH 20601
20972099
# GH 26314: Change ValueError to PerformanceWarning

pandas/tests/series/methods/test_round.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ def test_round_numpy(self, any_float_dtype):
3030
def test_round_numpy_with_nan(self, any_float_dtype):
3131
# See GH#14197
3232
ser = Series([1.53, np.nan, 0.06], dtype=any_float_dtype)
33-
with tm.assert_produces_warning(None):
34-
result = ser.round()
33+
result = ser.round() # on armhf, numpy warns
3534
expected = Series([2.0, np.nan, 0.0], dtype=any_float_dtype)
3635
tm.assert_series_equal(result, expected)
3736

pandas/tests/test_downstream.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
TimedeltaIndex,
2020
)
2121
import pandas._testing as tm
22+
from pandas.compat import IS64
2223
from pandas.core.arrays import (
2324
DatetimeArray,
2425
TimedeltaArray,
@@ -230,6 +231,11 @@ def test_missing_required_dependency():
230231
assert name in output
231232

232233

234+
@pytest.mark.xfail(
235+
condition=not IS64,
236+
reason="dask has different nativesize-int vs int64 type rules",
237+
strict=False,
238+
)
233239
def test_frame_setitem_dask_array_into_new_col():
234240
# GH#47128
235241

pandas/tests/test_sorting.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import numpy as np
66
import pytest
7+
from pandas.compat import IS64
78

89
from pandas import (
910
NA,
@@ -218,6 +219,7 @@ def test_int64_overflow_check_sum_col(self, left_right):
218219
assert result.name is None
219220

220221
@pytest.mark.slow
222+
@pytest.mark.xfail(condition=not IS64, reason="assumes default int is int64")
221223
@pytest.mark.parametrize("how", ["left", "right", "outer", "inner"])
222224
def test_int64_overflow_how_merge(self, left_right, how):
223225
left, right = left_right
@@ -228,6 +230,7 @@ def test_int64_overflow_how_merge(self, left_right, how):
228230
tm.assert_frame_equal(out, merge(left, right, how=how, sort=True))
229231

230232
@pytest.mark.slow
233+
@pytest.mark.xfail(condition=not IS64, reason="assumes default int is int64")
231234
def test_int64_overflow_sort_false_order(self, left_right):
232235
left, right = left_right
233236

@@ -239,6 +242,7 @@ def test_int64_overflow_sort_false_order(self, left_right):
239242
tm.assert_frame_equal(right, out[right.columns.tolist()])
240243

241244
@pytest.mark.slow
245+
@pytest.mark.xfail(condition=not IS64, reason="assumes default int is int64", strict=False)
242246
@pytest.mark.parametrize("how", ["left", "right", "outer", "inner"])
243247
@pytest.mark.parametrize("sort", [True, False])
244248
def test_int64_overflow_one_to_many_none_match(self, how, sort):

0 commit comments

Comments
 (0)