Skip to content

Commit 5ac4da5

Browse files
committed
cleanup box xfails
1 parent 7137dda commit 5ac4da5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pandas/tests/dtypes/cast/test_promote.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -524,15 +524,15 @@ def test_maybe_promote_any_with_timedelta64(
524524
dtype = np.dtype(any_numpy_dtype_reduced)
525525
boxed, box_dtype = box # read from parametrized fixture
526526

527-
if is_timedelta64_dtype(dtype):
528-
if boxed and (
529-
box_dtype == object
530-
or (box_dtype is None and not is_timedelta64_dtype(type(fill_value)))
531-
):
532-
pytest.xfail("falsely upcasts to object")
533-
else:
534-
if boxed and box_dtype is None and is_timedelta64_dtype(type(fill_value)):
535-
pytest.xfail("does not upcast correctly")
527+
if boxed:
528+
if is_timedelta64_dtype(dtype):
529+
if box_dtype == object:
530+
pytest.xfail("falsely upcasts to object")
531+
elif box_dtype is None and not is_timedelta64_dtype(type(fill_value)):
532+
pytest.xfail("falsely upcasts to object")
533+
else:
534+
if box_dtype is None and is_timedelta64_dtype(type(fill_value)):
535+
pytest.xfail("does not upcast correctly")
536536

537537
# special case for box_dtype
538538
box_dtype = np.dtype(timedelta64_dtype) if box_dtype == "td_dtype" else box_dtype

0 commit comments

Comments
 (0)