From: Debian Science Maintainers Date: Sat, 5 Oct 2024 10:43:25 +0000 (+0100) Subject: Don't require a warning armel numpy doesn't have X-Git-Tag: archive/raspbian/0.14.4+dfsg-1+rpi1^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=62ddd3ecfa6de486df414bc0dc7a8f0b7774f373;p=statsmodels.git Don't require a warning armel numpy doesn't have Author: Rebecca N. Palmer Forwarded: no (this version requires dpkg) Gbp-Pq: Name ignore_armel_nonwarning.patch --- diff --git a/statsmodels/stats/tests/test_rates_poisson.py b/statsmodels/stats/tests/test_rates_poisson.py index 5d2252f..dda02d8 100644 --- a/statsmodels/stats/tests/test_rates_poisson.py +++ b/statsmodels/stats/tests/test_rates_poisson.py @@ -4,6 +4,12 @@ import numpy as np from numpy import arange from numpy.testing import assert_allclose, assert_equal from scipy import stats +# armel numpy currently doesn't have the divide-by-0 warning (see 0.14.0-1 build log and https://bugs.debian.org/956882) +# using nullcontext() instead of warn=None to not start failing if this ever gets fixed +import subprocess +import contextlib +debian_arch = subprocess.run(["dpkg","--print-architecture"],capture_output=True,encoding='utf-8').stdout.strip() + # we cannot import test_poisson_2indep directly, pytest treats that as test from statsmodels.compat.python import PYTHON_IMPL_WASM @@ -718,7 +724,7 @@ class TestMethodsCompare2indep(): # check corner case count2 = 0, see issue #8313 if not PYTHON_IMPL_WASM: # No fp exception support in WASM - with pytest.warns(RuntimeWarning): + with (contextlib.nullcontext() if debian_arch=='armel' else pytest.warns(RuntimeWarning)): smr.test_poisson_2indep( count1, n1, 0, n2, method=meth, compare=compare,