From: Debian Science Team Date: Wed, 11 Jan 2023 07:34:28 +0000 (+0000) Subject: Fix arch-specific upstream xfails X-Git-Tag: archive/raspbian/1.5.3+dfsg-2+rpi1~1^2^2~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5e694eac3bc3855ccf156a4d1f62a85f5cbf0904;p=pandas.git 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 pandas/tests/window/test_rolling.py also gets an i386 xfail for rounding error that may be x87 excess precision Author: Rebecca N. Palmer Bug: https://github.com/pandas-dev/pandas/issues/38921, https://github.com/pandas-dev/pandas/issues/38798, https://github.com/pandas-dev/pandas/issues/41740, https://github.com/numpy/numpy/issues/19146 Forwarded: no Gbp-Pq: Name fix_overly_arch_specific_xfails.patch --- diff --git a/pandas/tests/groupby/test_groupby.py b/pandas/tests/groupby/test_groupby.py index ba39f762..f5b6688f 100644 --- a/pandas/tests/groupby/test_groupby.py +++ b/pandas/tests/groupby/test_groupby.py @@ -2573,7 +2573,7 @@ def test_groupby_series_with_tuple_name(): tm.assert_series_equal(result, expected) -@pytest.mark.xfail(not IS64, reason="GH#38778: fail on 32-bit system") +@pytest.mark.xfail(not IS64, reason="GH#38778: fail on 32-bit system", strict=False) @pytest.mark.parametrize( "func, values", [("sum", [97.0, 98.0]), ("mean", [24.25, 24.5])] ) @@ -2586,7 +2586,7 @@ def test_groupby_numerical_stability_sum_mean(func, values): tm.assert_frame_equal(result, expected) -@pytest.mark.xfail(not IS64, reason="GH#38778: fail on 32-bit system") +@pytest.mark.xfail(not IS64, reason="GH#38778: fail on 32-bit system", strict=False) def test_groupby_numerical_stability_cumsum(): # GH#38934 data = [1e16, 1e16, 97, 98, -5e15, -5e15, -5e15, -5e15] diff --git a/pandas/tests/io/parser/test_c_parser_only.py b/pandas/tests/io/parser/test_c_parser_only.py index ecc49ea8..ab3c811b 100644 --- a/pandas/tests/io/parser/test_c_parser_only.py +++ b/pandas/tests/io/parser/test_c_parser_only.py @@ -29,6 +29,9 @@ from pandas import ( concat, ) import pandas._testing as tm +import platform +import re +is_platform_x86 = bool(re.match('i.?86|x86',platform.uname()[4])) @pytest.mark.parametrize( @@ -680,9 +683,9 @@ def test_float_precision_options(c_parser_only): df3 = parser.read_csv(StringIO(s), float_precision="legacy") - if IS64: + if is_platform_x86 and IS64: assert not df.iloc[0, 0] == df3.iloc[0, 0] - else: + elif is_platform_x86: assert df.iloc[0, 0] == df3.iloc[0, 0] msg = "Unrecognized float_precision option: junk" diff --git a/pandas/tests/tools/test_to_numeric.py b/pandas/tests/tools/test_to_numeric.py index 38a50a10..c62aad04 100644 --- a/pandas/tests/tools/test_to_numeric.py +++ b/pandas/tests/tools/test_to_numeric.py @@ -760,7 +760,7 @@ def test_to_numeric_from_nullable_string(values, nullable_string_dtype, expected "UInt64", "signed", "UInt64", - marks=pytest.mark.xfail(not is_platform_arm(), reason="GH38798"), + marks=pytest.mark.xfail(strict=False, reason="GH38798"), ), ([1, 1], "Int64", "unsigned", "UInt8"), ([1.0, 1.0], "Float32", "unsigned", "UInt8"), diff --git a/pandas/tests/window/test_rolling.py b/pandas/tests/window/test_rolling.py index 25fc2c46..2f39d60f 100644 --- a/pandas/tests/window/test_rolling.py +++ b/pandas/tests/window/test_rolling.py @@ -13,7 +13,12 @@ import pytest from pandas.compat import ( is_platform_arm, is_platform_mac, + IS64, ) +import platform +import re +is_platform_x86_64 = bool(re.match('i.?86|x86',platform.uname()[4])) and IS64 + from pandas.errors import UnsupportedFunctionCall from pandas import ( @@ -1195,7 +1200,7 @@ def test_rolling_sem(frame_or_series): tm.assert_series_equal(result, expected) -@pytest.mark.xfail(is_platform_arm() and not is_platform_mac(), reason="GH 38921") +@pytest.mark.xfail(not is_platform_x86_64, strict=False, reason="GH 38921") @pytest.mark.parametrize( ("func", "third_value", "values"), [