diff --git a/pandas/tests/series/test_constructors.py b/pandas/tests/series/test_constructors.py index e4ab5ef596440..bc26158f40416 100644 --- a/pandas/tests/series/test_constructors.py +++ b/pandas/tests/series/test_constructors.py @@ -13,10 +13,7 @@ iNaT, lib, ) -from pandas.compat import ( - IS64, - is_numpy_dev, -) +from pandas.compat import is_numpy_dev from pandas.compat.numpy import np_version_gte1p24 import pandas.util._test_decorators as td @@ -736,22 +733,21 @@ def test_constructor_cast(self): with pytest.raises(ValueError, match=msg): Series(["a", "b", "c"], dtype=float) - @pytest.mark.xfail(np_version_gte1p24 and not IS64, reason="GH49777") def test_constructor_signed_int_overflow_deprecation(self): # GH#41734 disallow silent overflow msg = "Values are too large to be losslessly cast" - numpy_warning = DeprecationWarning if is_numpy_dev else None - with tm.assert_produces_warning( - (FutureWarning, numpy_warning), match=msg, check_stacklevel=False - ): + warns = ( + (FutureWarning, DeprecationWarning) + if is_numpy_dev or np_version_gte1p24 + else FutureWarning + ) + with tm.assert_produces_warning(warns, 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, numpy_warning), match=msg, check_stacklevel=False - ): + with tm.assert_produces_warning(warns, match=msg, check_stacklevel=False): ser = Series([1, 200, 923442], dtype="uint8") expected = Series([1, 200, 50], dtype="uint8")