@@ -436,17 +436,20 @@ def test_hasnans_isnans(self, index_flat):
436436 tm .assert_numpy_array_equal (idx ._isnan , expected )
437437 assert idx .hasnans is True
438438
439+
439440@pytest .mark .filterwarnings (r"ignore:PeriodDtype\[B\] is deprecated:FutureWarning" )
440441@pytest .mark .parametrize ("na_position" , [None , "middle" ])
441442def test_sort_values_invalid_na_position (index_with_missing , na_position ):
442443 non_na_values = [x for x in index_with_missing if pd .notna (x )]
443444 if len ({type (x ) for x in non_na_values }) > 1 :
444445 pytest .mark .xfail (
445- reason = "Sorting fails due to heterogeneous types in index (int vs str)" )
446+ reason = "Sorting fails due to heterogeneous types in index (int vs str)"
447+ )
446448
447449 with pytest .raises (ValueError , match = f"invalid na_position: { na_position } " ):
448450 index_with_missing .sort_values (na_position = na_position )
449451
452+
450453@pytest .mark .filterwarnings (r"ignore:PeriodDtype\[B\] is deprecated:FutureWarning" )
451454@pytest .mark .parametrize ("na_position" , ["first" , "last" ])
452455def test_sort_values_with_missing (index_with_missing , na_position , request ):
@@ -456,7 +459,8 @@ def test_sort_values_with_missing(index_with_missing, na_position, request):
456459 non_na_values = [x for x in index_with_missing if pd .notna (x )]
457460 if len ({type (x ) for x in non_na_values }) > 1 :
458461 pytest .mark .xfail (
459- reason = "Sorting fails due to heterogeneous types in index (int vs str)" )
462+ reason = "Sorting fails due to heterogeneous types in index (int vs str)"
463+ )
460464
461465 if isinstance (index_with_missing , CategoricalIndex ):
462466 request .applymarker (
0 commit comments