Fix arch-specific upstream xfails
authorDebian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Thu, 2 Dec 2021 16:32:54 +0000 (16:32 +0000)
committerJochen Sprickerhof <jspricke@debian.org>
Thu, 2 Dec 2021 16:32:54 +0000 (16:32 +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

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/indexes/interval/test_astype.py
pandas/tests/indexes/numeric/test_numeric.py
pandas/tests/io/parser/test_c_parser_only.py
pandas/tests/tools/test_to_numeric.py
pandas/tests/window/test_rolling.py

index b67e97ae6c6ff8ce0643e577f841c9623c75cb5f..d9981f71422d1b70096a08591545027231a65892 100644 (file)
@@ -2321,7 +2321,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])]
 )
@@ -2334,7 +2334,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 bdb9c3f97e79871aab6c433bdd4a45cb2b3bb55b..984b2d480500d703e1b4f76fd2bfb2378aa4a440 100644 (file)
@@ -20,6 +20,9 @@ from pandas import (
     interval_range,
 )
 import pandas._testing as tm
+import platform
+import re
+is_platform_x86 = bool(re.match('i.?86|x86',platform.uname()[4]))
 
 
 class AstypeTests:
@@ -170,7 +173,7 @@ class TestFloatSubtype(AstypeTests):
         )
         tm.assert_index_equal(result, expected)
 
-    @pytest.mark.xfail(is_platform_arm(), reason="GH 41740")
+    @pytest.mark.xfail(not is_platform_x86, reason="GH 41740", strict=False)
     def test_subtype_integer_errors(self):
         # float64 -> uint64 fails with negative values
         index = interval_range(-10.0, 10.0)
index 456c199d05ee290de0f895b87b162de177e56ab9..ec1e6d63ecd2a532327c78421fb27fb28cccf5d4 100644 (file)
@@ -533,7 +533,7 @@ class TestUInt64Index(NumericInt):
         tm.assert_index_equal(res, idx)
 
     @pytest.mark.xfail(
-        not is_platform_arm(),
+        strict=False,
         reason="https://github.com/numpy/numpy/issues/19146",
     )
     def test_constructor_does_not_cast_to_float(self):
index 2e3d6511fdfb9fb3b4db57903b506b54eb5fce59..e07644cfb8dafc2c0d0bc20dd46a9c90a33e0598 100644 (file)
@@ -26,6 +26,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(
@@ -673,9 +676,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 643a5617abbebbbf73b78c61f1c612c4a325e64f..94ec28962b94acb9d27be137651de53a6167b5d0 100644 (file)
@@ -752,7 +752,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 b4f9b1ef6cb552b6769af001066fb29886679d11..cd11ff6efc36573b790b2e510dfb76d005d41a6b 100644 (file)
@@ -10,6 +10,10 @@ from pandas.compat import (
     is_platform_arm,
     is_platform_mac,
 )
+import platform
+import re
+is_platform_x86 = bool(re.match('i.?86|x86',platform.uname()[4]))
+
 from pandas.errors import UnsupportedFunctionCall
 
 from pandas import (
@@ -1115,7 +1119,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, strict=False, reason="GH 38921")
 @pytest.mark.parametrize(
     ("func", "third_value", "values"),
     [