Don't fail test for rounding difference on i386
authorDebian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Tue, 31 Jan 2023 13:21:16 +0000 (13:21 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Tue, 31 Jan 2023 13:21:16 +0000 (13:21 +0000)
Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Bug-Debian: https://bugs.debian.org/968208
Forwarded: no

Gbp-Pq: Name 968208_rounding.patch

pandas/tests/window/test_rolling.py

index c9ec2985488be10b08819b19ec1e734b9eb40f46..25fc2c468ccc904dc646a1f504fde067af67d49b 100644 (file)
@@ -1,3 +1,7 @@
+import sys
+import platform
+import re
+
 from datetime import (
     datetime,
     timedelta,
@@ -1708,7 +1712,9 @@ def test_rolling_quantile_interpolation_options(quantile, interpolation, data):
     if np.isnan(q1):
         assert np.isnan(q2)
     else:
-        assert q1 == q2
+        assert np.abs(q1-q2)<1e-15
+        if not (re.match('i.?86|x86',platform.uname()[4]) and sys.maxsize<2**33):
+            assert q1 == q2
 
 
 def test_invalid_quantile_value():