|
13 | 13 | iNaT, |
14 | 14 | lib, |
15 | 15 | ) |
16 | | -from pandas.compat.numpy import ( |
17 | | - np_version_under1p19, |
18 | | - np_version_under1p20, |
19 | | -) |
| 16 | +from pandas.compat.numpy import np_version_under1p20 |
20 | 17 | import pandas.util._test_decorators as td |
21 | 18 |
|
22 | 19 | from pandas.core.dtypes.common import ( |
@@ -818,18 +815,11 @@ def test_constructor_coerce_float_valid(self, float_numpy_dtype): |
818 | 815 | expected = Series([1, 2, 3.5]).astype(float_numpy_dtype) |
819 | 816 | tm.assert_series_equal(s, expected) |
820 | 817 |
|
821 | | - def test_constructor_invalid_coerce_ints_with_float_nan( |
822 | | - self, any_int_numpy_dtype, request |
823 | | - ): |
| 818 | + def test_constructor_invalid_coerce_ints_with_float_nan(self, any_int_numpy_dtype): |
824 | 819 | # GH 22585 |
825 | 820 | # Updated: make sure we treat this list the same as we would treat the |
826 | | - # equivalent ndarray |
827 | | - if np_version_under1p19 and np.dtype(any_int_numpy_dtype).kind == "u": |
828 | | - mark = pytest.mark.xfail(reason="Produces an extra RuntimeWarning") |
829 | | - request.node.add_marker(mark) |
830 | | - |
| 821 | + # equivalent ndarray |
831 | 822 | vals = [1, 2, np.nan] |
832 | | - |
833 | 823 | msg = "In a future version, passing float-dtype values containing NaN" |
834 | 824 | with tm.assert_produces_warning(FutureWarning, match=msg): |
835 | 825 | res = Series(vals, dtype=any_int_numpy_dtype) |
@@ -1958,13 +1948,6 @@ def test_constructor(rand_series_with_duplicate_datetimeindex): |
1958 | 1948 | ({1: 1}, np.array([[1]], dtype=np.int64)), |
1959 | 1949 | ], |
1960 | 1950 | ) |
1961 | | -@pytest.mark.skipif(np_version_under1p19, reason="fails on numpy below 1.19") |
1962 | 1951 | def test_numpy_array(input_dict, expected): |
1963 | 1952 | result = np.array([Series(input_dict)]) |
1964 | 1953 | tm.assert_numpy_array_equal(result, expected) |
1965 | | - |
1966 | | - |
1967 | | -@pytest.mark.xfail(not np_version_under1p19, reason="check failure on numpy below 1.19") |
1968 | | -def test_numpy_array_np_v1p19(): |
1969 | | - with pytest.raises(KeyError, match="0"): |
1970 | | - np.array([Series({1: 1})]) |
0 commit comments