Skip to content

Commit 505abc1

Browse files
authored
CI: suppress npdev warnings (#41730)
1 parent e96ef03 commit 505abc1

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

pandas/conftest.py

+7
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@
6666
MultiIndex,
6767
)
6868

69+
# Until https://github.com/numpy/numpy/issues/19078 is sorted out, just suppress
70+
suppress_npdev_promotion_warning = pytest.mark.filterwarnings(
71+
"ignore:Promotion of numbers and bools:FutureWarning"
72+
)
73+
6974
# ----------------------------------------------------------------
7075
# Configuration / Settings
7176
# ----------------------------------------------------------------
@@ -112,6 +117,8 @@ def pytest_collection_modifyitems(items):
112117
if "/frame/" in item.nodeid:
113118
item.add_marker(pytest.mark.arraymanager)
114119

120+
item.add_marker(suppress_npdev_promotion_warning)
121+
115122

116123
# Hypothesis
117124
hypothesis.settings.register_profile(

pandas/tests/arithmetic/test_interval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def test_compare_list_like_nan(self, op, interval_array, nulls_fixture, request)
238238
Categorical(list("abab")),
239239
Categorical(date_range("2017-01-01", periods=4)),
240240
pd.array(list("abcd")),
241-
pd.array(["foo", 3.14, None, object()]),
241+
pd.array(["foo", 3.14, None, object()], dtype=object),
242242
],
243243
ids=lambda x: str(x.dtype),
244244
)

pandas/tests/frame/methods/test_to_records.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import numpy as np
44
import pytest
55

6+
from pandas.compat import is_numpy_dev
7+
68
from pandas import (
79
CategoricalDtype,
810
DataFrame,
@@ -171,20 +173,28 @@ def test_to_records_with_categorical(self):
171173
),
172174
),
173175
# Pass in a type instance.
174-
(
176+
pytest.param(
175177
{"column_dtypes": str},
176178
np.rec.array(
177179
[("0", "1", "0.2", "a"), ("1", "2", "1.5", "bc")],
178180
dtype=[("index", "<i8"), ("A", "<U"), ("B", "<U"), ("C", "<U")],
179181
),
182+
marks=pytest.mark.xfail(
183+
is_numpy_dev,
184+
reason="https://github.com/numpy/numpy/issues/19078",
185+
),
180186
),
181187
# Pass in a dtype instance.
182-
(
188+
pytest.param(
183189
{"column_dtypes": np.dtype("unicode")},
184190
np.rec.array(
185191
[("0", "1", "0.2", "a"), ("1", "2", "1.5", "bc")],
186192
dtype=[("index", "<i8"), ("A", "<U"), ("B", "<U"), ("C", "<U")],
187193
),
194+
marks=pytest.mark.xfail(
195+
is_numpy_dev,
196+
reason="https://github.com/numpy/numpy/issues/19078",
197+
),
188198
),
189199
# Pass in a dictionary (name-only).
190200
(

0 commit comments

Comments
 (0)