Fix arch-specific upstream xfails
authorDebian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Sun, 19 Feb 2023 11:01:48 +0000 (11:01 +0000)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Sun, 19 Feb 2023 11:01:48 +0000 (11:01 +0000)
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 <rebecca_palmer@zoho.com>
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

pandas/tests/groupby/test_groupby.py
pandas/tests/io/parser/test_c_parser_only.py
pandas/tests/tools/test_to_numeric.py
pandas/tests/window/test_rolling.py

index f6bbb9eda133d5e8a22c66d274e56ef562222379..aec44015bcb0d02df5fb99e0a3345eec7b541b6c 100644 (file)
@@ -2587,7 +2587,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])]
 )
@@ -2600,7 +2600,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]
index ecc49ea8adb9f7eb12a9b54c1a85b3b76cb77b8a..ab3c811b915e0572a4a884be89b20980136b0a78 100644 (file)
@@ -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"
index 38a50a10b34821278c7ebffc0ada80f64b223ed2..c62aad04bfe23ac4fe849caa727eb36b62f465d5 100644 (file)
@@ -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"),
index 25fc2c468ccc904dc646a1f504fde067af67d49b..2f39d60f3b68fdc8934c31a535a1d00a2f61e022 100644 (file)
@@ -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"),
     [