Skip to content

Commit 62c3319

Browse files
committed
Fix long line issue and refactor xfail usage in test_sort_values_invalid_na_position
1 parent 218071c commit 62c3319

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pandas/tests/indexes/test_common.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,10 @@ def test_hasnans_isnans(self, index_flat):
439439

440440
@pytest.mark.filterwarnings(r"ignore:PeriodDtype\[B\] is deprecated:FutureWarning")
441441
@pytest.mark.parametrize("na_position", [None, "middle"])
442-
@pytest.mark.xfail(reason="Sorting fails due to heterogeneous types in index (int vs str)")
442+
@pytest.mark.xfail(
443+
reason="Sorting fails due to heterogeneous types in index (int vs str)"
444+
)
445+
443446
def test_sort_values_invalid_na_position(index_with_missing, na_position):
444447
non_na_values = [x for x in index_with_missing if pd.notna(x)]
445448
if len({type(x) for x in non_na_values}) > 1:
@@ -451,7 +454,9 @@ def test_sort_values_invalid_na_position(index_with_missing, na_position):
451454

452455
@pytest.mark.filterwarnings(r"ignore:PeriodDtype\[B\] is deprecated:FutureWarning")
453456
@pytest.mark.parametrize("na_position", ["first", "last"])
454-
@pytest.mark.xfail(reason="Sorting fails due to heterogeneous types in index (int vs str)")
457+
@pytest.mark.xfail(
458+
reason="Sorting fails due to heterogeneous types in index (int vs str)"
459+
)
455460
def test_sort_values_with_missing(index_with_missing, na_position, request):
456461
# GH 35584. Test that sort_values works with missing values,
457462
# sort non-missing and place missing according to na_position

0 commit comments

Comments
 (0)