Skip to content

Commit 4a84cce

Browse files
Debian Science Teamrebecca-palmer
Debian Science Team
authored andcommitted
Don't require a warning armel numpy doesn't have
Author: Rebecca N. Palmer <[email protected]> Forwarded: no (this version requires dpkg) Gbp-Pq: Name armel_ignore_nonwarning.patch
1 parent 6c0ccbf commit 4a84cce

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pandas/tests/apply/test_str.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ def test_apply_np_reducer(op, how):
7272
@pytest.mark.parametrize("how", ["transform", "apply"])
7373
def test_apply_np_transformer(float_frame, op, how):
7474
# GH 39116
75+
# armel numpy currently doesn't have the invalid log/sqrt warning (see 1.4.3-1 build log,
76+
# possibly the same underlying issue as statsmodels https://bugs.debian.org/956882)
77+
# using nullcontext() instead of warn=None to not start failing if this ever gets fixed
78+
import subprocess
79+
import contextlib
80+
debian_arch = subprocess.run(["dpkg","--print-architecture"],capture_output=True).stdout
7581

7682
# float_frame will _usually_ have negative values, which will
7783
# trigger the warning here, but let's put one in just to be sure
@@ -80,7 +86,7 @@ def test_apply_np_transformer(float_frame, op, how):
8086
if op in ["log", "sqrt"]:
8187
warn = RuntimeWarning
8288

83-
with tm.assert_produces_warning(warn, check_stacklevel=False):
89+
with (contextlib.nullcontext() if (debian_arch==b'armel\n') else tm.assert_produces_warning(warn, check_stacklevel=False)):
8490
# float_frame fixture is defined in conftest.py, so we don't check the
8591
# stacklevel as otherwise the test would fail.
8692
result = getattr(float_frame, how)(op)

0 commit comments

Comments
 (0)