Don't fail test for rounding difference on i386
authorDebian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Sun, 16 Aug 2020 19:09:14 +0000 (20:09 +0100)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Sun, 16 Aug 2020 19:09:14 +0000 (20:09 +0100)
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_moments.py

index d860859958254c58a34697c169190c792cee5eb8..51fcac82c2790aac42576c29323ada7ca092819d 100644 (file)
@@ -1,6 +1,9 @@
 import copy
 from datetime import datetime
 import warnings
+import sys
+import platform
+import re
 
 import numpy as np
 from numpy.random import randn
@@ -606,7 +609,9 @@ class TestMoments(Base):
         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(self):
         data = np.arange(5)