|
13 | 13 | iNaT,
|
14 | 14 | lib,
|
15 | 15 | )
|
16 |
| -from pandas.compat import ( |
17 |
| - IS64, |
18 |
| - is_numpy_dev, |
19 |
| -) |
| 16 | +from pandas.compat import is_numpy_dev |
20 | 17 | from pandas.compat.numpy import np_version_gte1p24
|
21 | 18 | import pandas.util._test_decorators as td
|
22 | 19 |
|
@@ -736,22 +733,21 @@ def test_constructor_cast(self):
|
736 | 733 | with pytest.raises(ValueError, match=msg):
|
737 | 734 | Series(["a", "b", "c"], dtype=float)
|
738 | 735 |
|
739 |
| - @pytest.mark.xfail(np_version_gte1p24 and not IS64, reason="GH49777") |
740 | 736 | def test_constructor_signed_int_overflow_deprecation(self):
|
741 | 737 | # GH#41734 disallow silent overflow
|
742 | 738 | msg = "Values are too large to be losslessly cast"
|
743 |
| - numpy_warning = DeprecationWarning if is_numpy_dev else None |
744 |
| - with tm.assert_produces_warning( |
745 |
| - (FutureWarning, numpy_warning), match=msg, check_stacklevel=False |
746 |
| - ): |
| 739 | + warns = ( |
| 740 | + (FutureWarning, DeprecationWarning) |
| 741 | + if is_numpy_dev or np_version_gte1p24 |
| 742 | + else FutureWarning |
| 743 | + ) |
| 744 | + with tm.assert_produces_warning(warns, match=msg, check_stacklevel=False): |
747 | 745 | ser = Series([1, 200, 923442], dtype="int8")
|
748 | 746 |
|
749 | 747 | expected = Series([1, -56, 50], dtype="int8")
|
750 | 748 | tm.assert_series_equal(ser, expected)
|
751 | 749 |
|
752 |
| - with tm.assert_produces_warning( |
753 |
| - (FutureWarning, numpy_warning), match=msg, check_stacklevel=False |
754 |
| - ): |
| 750 | + with tm.assert_produces_warning(warns, match=msg, check_stacklevel=False): |
755 | 751 | ser = Series([1, 200, 923442], dtype="uint8")
|
756 | 752 |
|
757 | 753 | expected = Series([1, 200, 50], dtype="uint8")
|
|
0 commit comments