Skip to content

Commit e9bd466

Browse files
committed
test: simplify insertion sort stability doctest output
1 parent 58e9ab5 commit e9bd466

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎sorts/insertion_sort.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ def insertion_sort[T: Comparable](collection: MutableSequence[T]) -> MutableSequ
6464
... priority: int
6565
... label: str = field(compare=False)
6666
>>> items = [Item(2, "A"), Item(1, "X"), Item(2, "B"), Item(1, "Y")]
67-
>>> [(item.priority, item.label) for item in insertion_sort(items)]
68-
[(1, 'X'), (1, 'Y'), (2, 'A'), (2, 'B')]
67+
>>> insertion_sort(items) # doctest: +NORMALIZE_WHITESPACE
68+
[Item(priority=1, label='X'), Item(priority=1, label='Y'),
69+
Item(priority=2, label='A'), Item(priority=2, label='B')]
6970
7071
>>> import random
7172
>>> collection = random.sample(range(-50, 50), 100)

0 commit comments

Comments
 (0)