Skip to content
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

CI: Fix DeprecationWarning of numpy dev #49070

Merged
merged 2 commits into from Oct 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions pandas/tests/series/test_constructors.py
Expand Up @@ -14,6 +14,7 @@
iNaT,
lib,
)
from pandas.compat import is_numpy_dev
import pandas.util._test_decorators as td

from pandas.core.dtypes.common import (
Expand Down Expand Up @@ -735,13 +736,18 @@ def test_constructor_cast(self):
def test_constructor_signed_int_overflow_deprecation(self):
# GH#41734 disallow silent overflow
msg = "Values are too large to be losslessly cast"
with tm.assert_produces_warning(FutureWarning, match=msg):
numpy_warning = DeprecationWarning if is_numpy_dev else None
with tm.assert_produces_warning(
(FutureWarning, numpy_warning), match=msg, check_stacklevel=False
):
ser = Series([1, 200, 923442], dtype="int8")

expected = Series([1, -56, 50], dtype="int8")
tm.assert_series_equal(ser, expected)

with tm.assert_produces_warning(FutureWarning, match=msg):
with tm.assert_produces_warning(
(FutureWarning, numpy_warning), match=msg, check_stacklevel=False
):
ser = Series([1, 200, 923442], dtype="uint8")

expected = Series([1, 200, 50], dtype="uint8")
Expand Down