Skip to content

Commit c7cbeaa

Browse files
committed
test numpy compat
1 parent e0fddcc commit c7cbeaa

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

pandas/tests/indexes/multi/test_setops.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,9 +628,9 @@ def test_union_with_duplicates_keep_ea_dtype(dupe_val, any_numeric_ea_dtype):
628628
def test_union_duplicates(index, request):
629629
# special case for mixed types
630630
if index.inferred_type == "mixed":
631-
pytest.mark.xfail(
632-
reason="mixed type union with duplicates is not supported"
633-
)(request.node)
631+
pytest.mark.xfail(reason="mixed type union with duplicates is not supported")(
632+
request.node
633+
)
634634

635635
# GH#38977
636636
if index.empty or isinstance(index, (IntervalIndex, CategoricalIndex)):

pandas/tests/indexes/test_numpy_compat.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,11 @@ def test_numpy_ufuncs_reductions(index, func, request):
155155
# TODO: overlap with tests.series.test_ufunc.test_reductions
156156
if len(index) == 0:
157157
pytest.skip("Test doesn't make sense for empty index.")
158-
has_str = any(isinstance(x, str) for x in index)
159-
has_int = any(isinstance(x, int) for x in index)
160-
if has_str and has_int:
158+
if getattr(index, "inferred_type", None) in {
159+
"mixed",
160+
"mixed-integer",
161+
"mixed-int-string",
162+
}:
161163
request.applymarker(
162164
pytest.mark.xfail(
163165
reason="Cannot compare mixed types (int and str) in ufunc reductions"

0 commit comments

Comments
 (0)