Skip to content

Commit 0f81e89

Browse files
Debian Science Teamrebecca-palmer
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 8a698f7 commit 0f81e89

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

pandas/tests/apply/test_str.py

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

7480
# float_frame will _usually_ have negative values, which will
7581
# trigger the warning here, but let's put one in just to be sure
@@ -78,7 +84,7 @@ def test_apply_np_transformer(float_frame, op, how):
7884
if op in ["log", "sqrt"]:
7985
warn = RuntimeWarning
8086

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

pandas/tests/io/parser/test_c_parser_only.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ def test_delim_whitespace_custom_terminator(c_parser_only):
6363
expected = DataFrame([[1, 2, 3], [4, 5, 6], [7, 8, 9]], columns=["a", "b", "c"])
6464
tm.assert_frame_equal(df, expected)
6565

66+
# armel numpy currently doesn't have some invalid warnings (see 2.0.3+dfsg-3 build log,
67+
# possibly the same underlying issue as statsmodels https://bugs.debian.org/956882)
68+
# using nullcontext() instead of warn=None to not start failing if this ever gets fixed
69+
import subprocess
70+
import contextlib
71+
debian_arch = subprocess.run(["dpkg","--print-architecture"],capture_output=True).stdout
6672

6773
def test_dtype_and_names_error(c_parser_only):
6874
# see gh-8833: passing both dtype and names
@@ -98,7 +104,7 @@ def test_dtype_and_names_error(c_parser_only):
98104
# fallback casting, but not castable
99105
warning = RuntimeWarning if np_version_gte1p24 else None
100106
with pytest.raises(ValueError, match="cannot safely convert"):
101-
with tm.assert_produces_warning(warning, check_stacklevel=False):
107+
with (contextlib.nullcontext() if (debian_arch==b'armel\n') else tm.assert_produces_warning(warning, check_stacklevel=False)):
102108
parser.read_csv(
103109
StringIO(data),
104110
sep=r"\s+",

0 commit comments

Comments
 (0)