Skip to content

Commit b68dc54

Browse files
committed
Fix line length issue in tests
1 parent 62c3319 commit b68dc54

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

pandas/tests/indexes/test_common.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,9 @@ def test_hasnans_isnans(self, index_flat):
446446
def test_sort_values_invalid_na_position(index_with_missing, na_position):
447447
non_na_values = [x for x in index_with_missing if pd.notna(x)]
448448
if len({type(x) for x in non_na_values}) > 1:
449-
pytest.mark.xfail(reason="Sorting fails due to heterogeneous types in index (int vs str)")
449+
pytest.mark.xfail(
450+
reason="Sorting fails due to heterogeneous types in index (int vs str)"
451+
)
450452

451453
with pytest.raises(ValueError, match=f"invalid na_position: {na_position}"):
452454
index_with_missing.sort_values(na_position=na_position)
@@ -463,7 +465,9 @@ def test_sort_values_with_missing(index_with_missing, na_position, request):
463465

464466
non_na_values = [x for x in index_with_missing if pd.notna(x)]
465467
if len({type(x) for x in non_na_values}) > 1:
466-
pytest.mark.xfail(reason="Sorting fails due to heterogeneous types in index (int vs str)")
468+
pytest.mark.xfail(
469+
reason="Sorting fails due to heterogeneous types in index (int vs str)"
470+
)
467471

468472
if isinstance(index_with_missing, CategoricalIndex):
469473
request.applymarker(

pandas/tests/indexes/test_numpy_compat.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,12 @@ def test_numpy_ufuncs_reductions(index, func, request):
160160
any(isinstance(x, int) for x in index):
161161
request.applymarker(
162162
pytest.mark.xfail(
163-
reason="Cannot compare mixed types (int and str) in ufunc reductions" \
164-
" and should raise a TypeError"
163+
reason=(
164+
"Cannot compare mixed types (int and str) in ufunc reductions"
165+
" and should raise a TypeError"
166+
)
165167
)
166168
)
167-
168169
if isinstance(index, CategoricalIndex) and index.dtype.ordered is False:
169170
with pytest.raises(TypeError, match="is not ordered for"):
170171
func.reduce(index)

pandas/tests/indexes/test_setops.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,9 @@ def has_mixed_types(level):
926926
for idx in [index1, index2]:
927927
for lvl in range(idx.nlevels):
928928
if has_mixed_types(idx.get_level_values(lvl)):
929-
skip_message = f"Mixed types in MultiIndex level {lvl} are not orderable"
929+
skip_message = (
930+
f"Mixed types in MultiIndex level {lvl} are not orderable"
931+
)
930932
pytest.skip(skip_message)
931933

932934
result = index1.symmetric_difference(index2, sort=sort)

pandas/tests/test_algos.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ def test_factorize(self, index_or_series_obj, sort):
7777
pytest.skip("Skipping test for empty Index")
7878

7979
if obj.name == "mixed-int-string" or obj.name is None:
80-
skip_message = "Skipping test for mixed-int-string due to unsupported comparison between str and int"
80+
skip_message = (
81+
"Skipping test for mixed-int-string due to unsupported comparison "
82+
"between str and int"
83+
)
8184
pytest.skip(skip_message)
8285

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

0 commit comments

Comments
 (0)