Skip to content

Commit 9936584

Browse files
committed
marked fail and other tests fixed
1 parent b82961d commit 9936584

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

pandas/tests/indexes/test_common.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -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"])
441442
def 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"])
452455
def 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(

pandas/tests/test_algos.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ def test_factorize(self, index_or_series_obj, sort):
7575

7676
if obj.name == "mixed-int-string" or obj.name is None:
7777
pytest.skip(
78-
"Skipping test for mixed-int-string due to unsupported comparison between str and int"
78+
"Skipping test for mixed-int-string due to unsupported"
79+
"comparison between str and int"
7980
)
8081

8182
result_codes, result_uniques = obj.factorize(sort=sort)

0 commit comments

Comments
 (0)