Skip to content

Commit c671f6c

Browse files
authored
CI: Fix DeprecationWarning of numpy dev (#49070)
* CI: Fix DeprecationWarning of numpy dev * CI: Fix DeprecationWarning of numpy dev
1 parent 243a5e1 commit c671f6c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pandas/tests/series/test_constructors.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
iNaT,
1515
lib,
1616
)
17+
from pandas.compat import is_numpy_dev
1718
import pandas.util._test_decorators as td
1819

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

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

744-
with tm.assert_produces_warning(FutureWarning, match=msg):
748+
with tm.assert_produces_warning(
749+
(FutureWarning, numpy_warning), match=msg, check_stacklevel=False
750+
):
745751
ser = Series([1, 200, 923442], dtype="uint8")
746752

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

0 commit comments

Comments
 (0)