Skip to content

Commit cba1e84

Browse files
Debian Science Teamrebecca-palmer
Debian Science Team
authored andcommitted
Fix arch-specific upstream xfails
We test on more architectures, so upstream's xfails are not always correct everywhere. On those known to fail: arm64 xfail -> all non-x86 xfail x86 or unconditional strict xfail -> unconditional nonstrict xfail Author: Rebecca N. Palmer <[email protected]> Bug: pandas-dev/pandas#38921, pandas-dev/pandas#38798, pandas-dev/pandas#41740, numpy/numpy#19146 Forwarded: no Gbp-Pq: Name fix_overly_arch_specific_xfails.patch
1 parent c43c22b commit cba1e84

File tree

6 files changed

+18
-8
lines changed

6 files changed

+18
-8
lines changed

pandas/tests/groupby/test_groupby.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2321,7 +2321,7 @@ def test_groupby_series_with_tuple_name():
23212321
tm.assert_series_equal(result, expected)
23222322

23232323

2324-
@pytest.mark.xfail(not IS64, reason="GH#38778: fail on 32-bit system")
2324+
@pytest.mark.xfail(not IS64, reason="GH#38778: fail on 32-bit system", strict=False)
23252325
@pytest.mark.parametrize(
23262326
"func, values", [("sum", [97.0, 98.0]), ("mean", [24.25, 24.5])]
23272327
)
@@ -2334,7 +2334,7 @@ def test_groupby_numerical_stability_sum_mean(func, values):
23342334
tm.assert_frame_equal(result, expected)
23352335

23362336

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

pandas/tests/indexes/interval/test_astype.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
interval_range,
2121
)
2222
import pandas._testing as tm
23+
import platform
24+
import re
25+
is_platform_x86 = bool(re.match('i.?86|x86',platform.uname()[4]))
2326

2427

2528
class AstypeTests:
@@ -170,7 +173,7 @@ def test_subtype_integer_with_non_integer_borders(self, subtype):
170173
)
171174
tm.assert_index_equal(result, expected)
172175

173-
@pytest.mark.xfail(is_platform_arm(), reason="GH 41740")
176+
@pytest.mark.xfail(not is_platform_x86, reason="GH 41740", strict=False)
174177
def test_subtype_integer_errors(self):
175178
# float64 -> uint64 fails with negative values
176179
index = interval_range(-10.0, 10.0)

pandas/tests/indexes/numeric/test_numeric.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def test_constructor(self, dtype):
533533
tm.assert_index_equal(res, idx)
534534

535535
@pytest.mark.xfail(
536-
not is_platform_arm(),
536+
strict=False,
537537
reason="https://github.com/numpy/numpy/issues/19146",
538538
)
539539
def test_constructor_does_not_cast_to_float(self):

pandas/tests/io/parser/test_c_parser_only.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
concat,
2727
)
2828
import pandas._testing as tm
29+
import platform
30+
import re
31+
is_platform_x86 = bool(re.match('i.?86|x86',platform.uname()[4]))
2932

3033

3134
@pytest.mark.parametrize(
@@ -673,9 +676,9 @@ def test_float_precision_options(c_parser_only):
673676

674677
df3 = parser.read_csv(StringIO(s), float_precision="legacy")
675678

676-
if IS64:
679+
if is_platform_x86 and IS64:
677680
assert not df.iloc[0, 0] == df3.iloc[0, 0]
678-
else:
681+
elif is_platform_x86:
679682
assert df.iloc[0, 0] == df3.iloc[0, 0]
680683

681684
msg = "Unrecognized float_precision option: junk"

pandas/tests/tools/test_to_numeric.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ def test_to_numeric_from_nullable_string(values, nullable_string_dtype, expected
752752
"UInt64",
753753
"signed",
754754
"UInt64",
755-
marks=pytest.mark.xfail(not is_platform_arm(), reason="GH38798"),
755+
marks=pytest.mark.xfail(strict=False, reason="GH38798"),
756756
),
757757
([1, 1], "Int64", "unsigned", "UInt8"),
758758
([1.0, 1.0], "Float32", "unsigned", "UInt8"),

pandas/tests/window/test_rolling.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
is_platform_arm,
1111
is_platform_mac,
1212
)
13+
import platform
14+
import re
15+
is_platform_x86 = bool(re.match('i.?86|x86',platform.uname()[4]))
16+
1317
from pandas.errors import UnsupportedFunctionCall
1418

1519
from pandas import (
@@ -1115,7 +1119,7 @@ def test_rolling_sem(frame_or_series):
11151119
tm.assert_series_equal(result, expected)
11161120

11171121

1118-
@pytest.mark.xfail(is_platform_arm() and not is_platform_mac(), reason="GH 38921")
1122+
@pytest.mark.xfail(not is_platform_x86, strict=False, reason="GH 38921")
11191123
@pytest.mark.parametrize(
11201124
("func", "third_value", "values"),
11211125
[

0 commit comments

Comments
 (0)