@@ -272,10 +272,6 @@ def test_maybe_promote_any_with_bool(any_numpy_dtype_reduced, box):
272
272
pytest .xfail ("falsely upcasts to object" )
273
273
if boxed and dtype not in (str , object ) and box_dtype is None :
274
274
pytest .xfail ("falsely upcasts to object" )
275
- if not boxed and dtype .kind == "M" :
276
- pytest .xfail ("raises error" )
277
- if not boxed and dtype .kind == "m" :
278
- pytest .xfail ("raises error" )
279
275
280
276
# filling anything but bool with bool casts to object
281
277
expected_dtype = np .dtype (object ) if dtype != bool else dtype
@@ -348,8 +344,6 @@ def test_maybe_promote_any_with_datetime64(
348
344
or (box_dtype is None and is_datetime64_dtype (type (fill_value )))
349
345
):
350
346
pytest .xfail ("mix of lack of upcasting, resp. wrong missing value" )
351
- if not boxed and is_timedelta64_dtype (dtype ):
352
- pytest .xfail ("raises error" )
353
347
354
348
# special case for box_dtype
355
349
box_dtype = np .dtype (datetime64_dtype ) if box_dtype == "dt_dtype" else box_dtype
@@ -490,9 +484,7 @@ def test_maybe_promote_any_numpy_dtype_with_datetimetz(
490
484
fill_dtype = DatetimeTZDtype (tz = tz_aware_fixture )
491
485
boxed , box_dtype = box # read from parametrized fixture
492
486
493
- if dtype .kind == "m" and not boxed :
494
- pytest .xfail ("raises error" )
495
- elif dtype .kind == "M" and not boxed :
487
+ if dtype .kind == "M" and not boxed :
496
488
pytest .xfail ("Comes back as M8 instead of object" )
497
489
498
490
fill_value = pd .Series ([fill_value ], dtype = fill_dtype )[0 ]
@@ -549,8 +541,6 @@ def test_maybe_promote_any_with_timedelta64(
549
541
else :
550
542
if boxed and box_dtype is None and is_timedelta64_dtype (type (fill_value )):
551
543
pytest .xfail ("does not upcast correctly" )
552
- if not boxed and is_datetime64_dtype (dtype ):
553
- pytest .xfail ("raises error" )
554
544
555
545
# special case for box_dtype
556
546
box_dtype = np .dtype (timedelta64_dtype ) if box_dtype == "td_dtype" else box_dtype
@@ -622,9 +612,6 @@ def test_maybe_promote_any_with_string(any_numpy_dtype_reduced, string_dtype, bo
622
612
fill_dtype = np .dtype (string_dtype )
623
613
boxed , box_dtype = box # read from parametrized fixture
624
614
625
- if is_datetime_or_timedelta_dtype (dtype ) and box_dtype != object :
626
- pytest .xfail ("does not upcast or raises" )
627
-
628
615
# create array of given dtype
629
616
fill_value = "abc"
630
617
@@ -678,9 +665,6 @@ def test_maybe_promote_any_with_object(any_numpy_dtype_reduced, object_dtype, bo
678
665
dtype = np .dtype (any_numpy_dtype_reduced )
679
666
boxed , box_dtype = box # read from parametrized fixture
680
667
681
- if not boxed and is_datetime_or_timedelta_dtype (dtype ):
682
- pytest .xfail ("raises error" )
683
-
684
668
# create array of object dtype from a scalar value (i.e. passing
685
669
# dtypes.common.is_scalar), which can however not be cast to int/float etc.
686
670
fill_value = pd .DateOffset (1 )
0 commit comments