Don't require warnings that not all arches produce
authorDebian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Fri, 24 Apr 2020 14:17:04 +0000 (15:17 +0100)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Fri, 24 Apr 2020 14:17:04 +0000 (15:17 +0100)
numpy 0/0 (in tvalues): armel doesn't
scipy.stats NaN: Upstream already note i386 doesn't,
we find ppc64el and s390x don't either

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Bug-Debian: https://bugs.debian.org/956882
Forwarded: no

Gbp-Pq: Name dont_require_warnings.patch

statsmodels/base/tests/test_generic_methods.py

index cedc27e57bd6cd30c20a1da20653dfa25edb3b26..7e7b24c9c0a18cad89a572283cfed8f17070ead6 100644 (file)
@@ -109,19 +109,11 @@ class CheckGenericMixin(object):
         assert_equal(res1.bse[drop_index], 0)
         # OSX has many slight failures on this test
         tol = 1e-8 if PLATFORM_OSX else 1e-10
-        with pytest.warns(RuntimeWarning, match="invalid value encountered"):
-            # division by zero in bse
-            tvals1 = res1.tvalues[keep_index_p]
+        tvals1 = res1.tvalues[keep_index_p]
         assert_allclose(tvals1, res2.tvalues, rtol=tol, atol=tol)
 
         # See gh5993
-        if PLATFORM_LINUX32 or SCIPY_GT_14:
-            pvals1 = res1.pvalues[keep_index_p]
-        else:
-            with pytest.warns(RuntimeWarning,
-                              match="invalid value encountered"):
-                # passing NaN into scipy.stats functions
-                pvals1 = res1.pvalues[keep_index_p]
+        pvals1 = res1.pvalues[keep_index_p]
         assert_allclose(pvals1, res2.pvalues, rtol=tol, atol=tol)
 
         if hasattr(res1, 'resid'):
@@ -259,19 +251,11 @@ class CheckGenericMixin(object):
             assert_allclose(res1.params[drop_index], 0, rtol=1e-10)
             assert_allclose(res1.bse[keep_index_p], res2.bse, rtol=1e-8)
             assert_allclose(res1.bse[drop_index], 0, rtol=1e-10)
-            with pytest.warns(RuntimeWarning, match="invalid value"):
-                # zero in bse, so division by zero warning
-                tvals1 = res1.tvalues[keep_index_p]
+            tvals1 = res1.tvalues[keep_index_p]
             assert_allclose(tvals1, res2.tvalues, rtol=5e-8)
 
             # See gh5993
-            if PLATFORM_LINUX32 or SCIPY_GT_14:
-                pvals1 = res1.pvalues[keep_index_p]
-            else:
-                with pytest.warns(RuntimeWarning,
-                                  match="invalid value encountered"):
-                    # passing NaN into scipy.stats functions
-                    pvals1 = res1.pvalues[keep_index_p]
+            pvals1 = res1.pvalues[keep_index_p]
             assert_allclose(pvals1, res2.pvalues, rtol=1e-6, atol=1e-30)
 
             if hasattr(res1, 'resid'):