From 9fe92b05a8849e2c9b90ce985d8836caa061b233 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Fri, 17 Nov 2023 13:28:27 -0800 Subject: [PATCH] Don't skip because of duplicates --- pandas/tests/indexes/test_setops.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pandas/tests/indexes/test_setops.py b/pandas/tests/indexes/test_setops.py index 592664542872b..d126d32e627cd 100644 --- a/pandas/tests/indexes/test_setops.py +++ b/pandas/tests/indexes/test_setops.py @@ -364,8 +364,9 @@ def test_corner_union(self, index_flat, fname, sname, expected_name): ) def test_union_unequal(self, index_flat, fname, sname, expected_name): if not index_flat.is_unique: - pytest.skip("Randomly generated index_flat was not unique.") - index = index_flat + index = index_flat.unique() + else: + index = index_flat # test copy.union(subset) - need sort for unicode and string first = index.copy().set_names(fname) @@ -388,8 +389,9 @@ def test_corner_intersect(self, index_flat, fname, sname, expected_name): # GH#35847 # Test intersections with various name combinations if not index_flat.is_unique: - pytest.skip("Randomly generated index_flat was not unique.") - index = index_flat + index = index_flat.unique() + else: + index = index_flat # Test copy.intersection(copy) first = index.copy().set_names(fname) @@ -431,8 +433,9 @@ def test_corner_intersect(self, index_flat, fname, sname, expected_name): ) def test_intersect_unequal(self, index_flat, fname, sname, expected_name): if not index_flat.is_unique: - pytest.skip("Randomly generated index_flat was not unique.") - index = index_flat + index = index_flat.unique() + else: + index = index_flat # test copy.intersection(subset) - need sort for unicode and string first = index.copy().set_names(fname)