@@ -540,17 +540,17 @@ def test_supported_astype(dtype):
540540 assert back == orig
541541
542542
543- # @pytest.mark.parametrize("dtype", ["S10", "U10", "T", "V10", "datetime64[ms]", "timedelta64[ms]"])
544- # def test_unsupported_astype(dtype):
545- # if dtype == "V10":
546- # with pytest.raises(TypeError, match="cast"):
547- # np.ones((3, 3), dtype="V10").astype(QuadPrecDType, casting="unsafe")
548- # else:
549- # with pytest.raises(TypeError, match="cast"):
550- # np.array(1, dtype=dtype).astype(QuadPrecDType, casting="unsafe")
551-
552- # with pytest.raises(TypeError, match="cast"):
553- # np.array(QuadPrecision(1)).astype(dtype, casting="unsafe")
543+ @pytest .mark .parametrize ("dtype" , ["V10" , "datetime64[ms]" , "timedelta64[ms]" ])
544+ def test_unsupported_astype (dtype ):
545+ if dtype == "V10" :
546+ with pytest .raises (TypeError , match = "cast" ):
547+ np .ones ((3 , 3 ), dtype = "V10" ).astype (QuadPrecDType , casting = "unsafe" )
548+ else :
549+ with pytest .raises (TypeError , match = "cast" ):
550+ np .array (1 , dtype = dtype ).astype (QuadPrecDType , casting = "unsafe" )
551+
552+ with pytest .raises (TypeError , match = "cast" ):
553+ np .array (QuadPrecision (1 )).astype (dtype , casting = "unsafe" )
554554
555555class TestArrayCastStringBytes :
556556 @pytest .mark .parametrize ("strtype" , [np .str_ , str ])
0 commit comments