Skip to content

Commit 27c8aff

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 7c9b6a8 commit 27c8aff

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

sorts/quick_sort_with_tests.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ def quick_sort(arr: List[int]) -> List[int]:
2121
return quick_sort(left) + middle + quick_sort(right)
2222

2323

24-
def quick_sort_3way(arr: List[int], low: int = 0, high: Optional[int] = None) -> List[int]:
24+
def quick_sort_3way(
25+
arr: List[int], low: int = 0, high: Optional[int] = None
26+
) -> List[int]:
2527
"""
2628
In-place 3-way partitioning quick sort.
2729
@@ -71,8 +73,12 @@ def test_quick_sorts():
7173
]
7274

7375
for i, (input_arr, expected) in enumerate(test_cases):
74-
assert quick_sort(input_arr) == expected, f"quick_sort failed on test case {i + 1}"
75-
assert quick_sort_3way(input_arr.copy()) == expected, f"quick_sort_3way failed on test case {i + 1}"
76+
assert quick_sort(input_arr) == expected, (
77+
f"quick_sort failed on test case {i + 1}"
78+
)
79+
assert quick_sort_3way(input_arr.copy()) == expected, (
80+
f"quick_sort_3way failed on test case {i + 1}"
81+
)
7682

7783
print("All tests passed!")
7884

0 commit comments

Comments
 (0)