diff --git a/pandas/tests/series/test_constructors.py b/pandas/tests/series/test_constructors.py index a49b41c8747c9..090335f20a91d 100644 --- a/pandas/tests/series/test_constructors.py +++ b/pandas/tests/series/test_constructors.py @@ -1579,11 +1579,11 @@ def test_convert_non_ns(self): tm.assert_series_equal(ser, expected) # try to construct from a sequence asking for non-ns timedelta64 - with pytest.raises(TypeError, match=r"Only \[ns\] granularity"): + with pytest.raises(TypeError, match=r"Only \[ns\] granularity is supported"): Series([1000000, 200000, 3000000], dtype="timedelta64[s]") # try to construct from a sequence asking for non-ns datetime64 - with pytest.raises(TypeError, match=r"Only \[ns\] granularity"): + with pytest.raises(TypeError, match=r"Only \[ns\] granularity is supported"): Series([1000000, 200000, 3000000], dtype="datetime64[s]") @pytest.mark.parametrize( @@ -1650,8 +1650,8 @@ def test_constructor_generic_timestamp_no_frequency(self, dtype, request): @pytest.mark.parametrize( "dtype,msg", [ - ("m8[ps]", "cannot convert timedeltalike"), - ("M8[ps]", "cannot convert datetimelike"), + ("m8[ps]", "Only \[ns\] granularity is supported"), + ("M8[ps]", "Only \[ns\] granularity is supported"), ], ) def test_constructor_generic_timestamp_bad_frequency(self, dtype, msg): @@ -1894,22 +1894,6 @@ def test_constructor_dtype_timedelta_alternative_construct(self): expected = Series(pd.to_timedelta([1000000, 200000, 3000000], unit="ns")) tm.assert_series_equal(result, expected) - def test_constructor_dtype_timedelta_ns_s(self): - # GH#35465 - result = Series([1000000, 200000, 3000000], dtype="timedelta64[ns]") - expected = Series([1000000, 200000, 3000000], dtype="timedelta64[s]") - tm.assert_series_equal(result, expected) - - def test_constructor_dtype_timedelta_ns_s_astype_int64(self): - # GH#35465 - result = Series([1000000, 200000, 3000000], dtype="timedelta64[ns]").astype( - "int64" - ) - expected = Series([1000000, 200000, 3000000], dtype="timedelta64[s]").astype( - "int64" - ) - tm.assert_series_equal(result, expected) - @pytest.mark.filterwarnings( "ignore:elementwise comparison failed:DeprecationWarning" )