Skip to content

Commit c3b352f

Browse files
committed
reset
1 parent e0fddcc commit c3b352f

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
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_setops.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -924,22 +924,24 @@ def test_difference_incomparable_true(self, opname):
924924
with pytest.raises(TypeError, match=msg):
925925
op(a)
926926

927-
def test_symmetric_difference_mi(self, sort):
927+
def test_symmetric_difference_mi(self, sort, request):
928928
index1 = MultiIndex.from_tuples(zip(["foo", "bar", "baz"], [1, 2, 3]))
929929
index2 = MultiIndex.from_tuples([("foo", 1), ("bar", 3)])
930930

931-
def has_mixed_types(level):
932-
return any(isinstance(x, str) for x in level) and any(
933-
isinstance(x, int) for x in level
934-
)
935-
936931
for idx in [index1, index2]:
937932
for lvl in range(idx.nlevels):
938-
if has_mixed_types(idx.get_level_values(lvl)):
939-
pytest.skip(
940-
f"Mixed types in MultiIndex level {lvl} are not orderable"
933+
level = idx.get_level_values(lvl)
934+
if getattr(level, "inferred_type", None) in {
935+
"mixed",
936+
"mixed-integer",
937+
"mixed-int-string",
938+
}:
939+
request.applymarker(
940+
pytest.mark.xfail(
941+
reason=f"Mixed types in MultiIndex level {lvl} "
942+
"are not orderable"
943+
)
941944
)
942-
943945
result = index1.symmetric_difference(index2, sort=sort)
944946
expected = MultiIndex.from_tuples([("bar", 2), ("baz", 3), ("bar", 3)])
945947
if sort is None:

pandas/tests/test_algos.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ def test_factorize_complex(self):
6363
expected_uniques = np.array([(1 + 0j), (2 + 0j), (2 + 1j)], dtype=complex)
6464
tm.assert_numpy_array_equal(uniques, expected_uniques)
6565

66-
@pytest.mark.parametrize(
67-
"index_or_series_obj", [[1, 2, 3], ["a", "b", "c"], [0, "a", 1, "b", 2, "c"]]
68-
)
69-
@pytest.mark.parametrize("sort", [True, False])
7066
def test_factorize(self, index_or_series_obj, sort):
7167
obj = Index(index_or_series_obj)
7268

0 commit comments

Comments
 (0)