Skip to content

Commit 79c890d

Browse files
author
Shreya
committed
Add doctest.testmod() call to gnome_sort main block
1 parent 8af4051 commit 79c890d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

sorts/gnome_sort.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
For manual testing run:
1212
python3 gnome_sort.py
1313
"""
14+
from doctest import testmod
1415

1516

1617
def gnome_sort(lst: list) -> list:
@@ -51,6 +52,10 @@ def gnome_sort(lst: list) -> list:
5152

5253

5354
if __name__ == "__main__":
55+
import doctest
56+
57+
doctest.testmod()
58+
5459
user_input = input("Enter numbers separated by a comma:\n").strip()
5560
unsorted = [int(item) for item in user_input.split(",")]
5661
print(gnome_sort(unsorted))

0 commit comments

Comments
 (0)