Skip to content

CI: suppress npdev warnings #41730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pandas/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
MultiIndex,
)

# Until https://github.com/numpy/numpy/issues/19078 is sorted out, just suppress
suppress_npdev_promotion_warning = pytest.mark.filterwarnings(
"ignore:Promotion of numbers and bools:FutureWarning"
)

# ----------------------------------------------------------------
# Configuration / Settings
# ----------------------------------------------------------------
Expand Down Expand Up @@ -112,6 +117,8 @@ def pytest_collection_modifyitems(items):
if "/frame/" in item.nodeid:
item.add_marker(pytest.mark.arraymanager)

item.add_marker(suppress_npdev_promotion_warning)


# Hypothesis
hypothesis.settings.register_profile(
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/arithmetic/test_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def test_compare_list_like_nan(self, op, interval_array, nulls_fixture, request)
Categorical(list("abab")),
Categorical(date_range("2017-01-01", periods=4)),
pd.array(list("abcd")),
pd.array(["foo", 3.14, None, object()]),
pd.array(["foo", 3.14, None, object()], dtype=object),
],
ids=lambda x: str(x.dtype),
)
Expand Down
14 changes: 12 additions & 2 deletions pandas/tests/frame/methods/test_to_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import numpy as np
import pytest

from pandas.compat import is_numpy_dev

from pandas import (
CategoricalDtype,
DataFrame,
Expand Down Expand Up @@ -171,20 +173,28 @@ def test_to_records_with_categorical(self):
),
),
# Pass in a type instance.
(
pytest.param(
{"column_dtypes": str},
np.rec.array(
[("0", "1", "0.2", "a"), ("1", "2", "1.5", "bc")],
dtype=[("index", "<i8"), ("A", "<U"), ("B", "<U"), ("C", "<U")],
),
marks=pytest.mark.xfail(
is_numpy_dev,
reason="https://github.com/numpy/numpy/issues/19078",
),
),
# Pass in a dtype instance.
(
pytest.param(
{"column_dtypes": np.dtype("unicode")},
np.rec.array(
[("0", "1", "0.2", "a"), ("1", "2", "1.5", "bc")],
dtype=[("index", "<i8"), ("A", "<U"), ("B", "<U"), ("C", "<U")],
),
marks=pytest.mark.xfail(
is_numpy_dev,
reason="https://github.com/numpy/numpy/issues/19078",
),
),
# Pass in a dictionary (name-only).
(
Expand Down