Skip to content

Commit 7fe25bc

Browse files
committed
clean up not-boxed xfails
1 parent 5ac4da5 commit 7fe25bc

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

pandas/tests/dtypes/cast/test_promote.py

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -678,24 +678,16 @@ def test_maybe_promote_any_numpy_dtype_with_na(
678678
dtype = np.dtype(any_numpy_dtype_reduced)
679679
boxed, box_dtype = box # read from parametrized fixture
680680

681-
if (
682-
dtype == bytes
683-
and not boxed
684-
and fill_value is not None
685-
and fill_value is not NaT
686-
):
687-
pytest.xfail("does not upcast to object")
688-
elif dtype == "uint64" and not boxed and fill_value == iNaT:
689-
pytest.xfail("does not upcast correctly")
690-
# below: opinionated that iNaT should be interpreted as missing value
691-
elif (
692-
not boxed
693-
and (is_float_dtype(dtype) or is_complex_dtype(dtype))
694-
and fill_value == iNaT
695-
):
696-
pytest.xfail("does not cast to missing value marker correctly")
697-
elif (is_string_dtype(dtype) or dtype == bool) and not boxed and fill_value == iNaT:
698-
pytest.xfail("does not cast to missing value marker correctly")
681+
if not boxed:
682+
if dtype == bytes and fill_value is not None and fill_value is not NaT:
683+
pytest.xfail("does not upcast to object")
684+
elif dtype == "uint64" and fill_value == iNaT:
685+
pytest.xfail("does not upcast correctly")
686+
# below: opinionated that iNaT should be interpreted as missing value
687+
elif (is_float_dtype(dtype) or is_complex_dtype(dtype)) and fill_value == iNaT:
688+
pytest.xfail("does not cast to missing value marker correctly")
689+
elif (is_string_dtype(dtype) or dtype == bool) and fill_value == iNaT:
690+
pytest.xfail("does not cast to missing value marker correctly")
699691

700692
if is_integer_dtype(dtype) and dtype == "uint64" and fill_value == iNaT:
701693
# uint64 + negative int casts to object; iNaT is considered as missing

0 commit comments

Comments
 (0)