Skip to content

Commit c42ac08

Browse files
committed
Fix pytest.xfail usage in test_sort_values_with_missing
1 parent 03c3b0a commit c42ac08

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/tests/indexes/test_common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,13 +450,14 @@ def test_sort_values_invalid_na_position(index_with_missing, na_position):
450450

451451
@pytest.mark.filterwarnings(r"ignore:PeriodDtype\[B\] is deprecated:FutureWarning")
452452
@pytest.mark.parametrize("na_position", ["first", "last"])
453+
@pytest.mark.xfail(reason="Sorting fails due to heterogeneous types in index (int vs str)")
453454
def test_sort_values_with_missing(index_with_missing, na_position, request):
454455
# GH 35584. Test that sort_values works with missing values,
455456
# sort non-missing and place missing according to na_position
456457

457458
non_na_values = [x for x in index_with_missing if pd.notna(x)]
458459
if len({type(x) for x in non_na_values}) > 1:
459-
pytest.xfail("Sorting fails due to heterogeneous types in index (int vs str)")
460+
pytest.mark.xfail(reason="Sorting fails due to heterogeneous types in index (int vs str)")
460461

461462
if isinstance(index_with_missing, CategoricalIndex):
462463
request.applymarker(

0 commit comments

Comments
 (0)