From 48c6cbdd39466d09296ca3ad1ca3173ab7e5f012 Mon Sep 17 00:00:00 2001 From: Navanitha Sri Date: Sun, 5 Oct 2025 19:54:34 +0530 Subject: [PATCH 1/3] Add pytest for heap_sort --- tests/test_sorts.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/test_sorts.py diff --git a/tests/test_sorts.py b/tests/test_sorts.py new file mode 100644 index 000000000000..5871569cd6c9 --- /dev/null +++ b/tests/test_sorts.py @@ -0,0 +1,8 @@ +from sorts.heap_sort import heap_sort + +def test_heap_sort(): + assert heap_sort([]) == [] + assert heap_sort([1]) == [1] + assert heap_sort([5,2,5,1]) == [1,2,5,5] + assert heap_sort([1,2,3,4]) == [1,2,3,4] + assert heap_sort([5,4,3,2,1]) == [1,2,3,4,5] From 2646f2734361a89ebff57ed8d8b8514ed5c49499 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 5 Oct 2025 15:36:38 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/test_sorts.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_sorts.py b/tests/test_sorts.py index 5871569cd6c9..bb2753cf2d79 100644 --- a/tests/test_sorts.py +++ b/tests/test_sorts.py @@ -1,8 +1,9 @@ from sorts.heap_sort import heap_sort + def test_heap_sort(): assert heap_sort([]) == [] assert heap_sort([1]) == [1] - assert heap_sort([5,2,5,1]) == [1,2,5,5] - assert heap_sort([1,2,3,4]) == [1,2,3,4] - assert heap_sort([5,4,3,2,1]) == [1,2,3,4,5] + assert heap_sort([5, 2, 5, 1]) == [1, 2, 5, 5] + assert heap_sort([1, 2, 3, 4]) == [1, 2, 3, 4] + assert heap_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5] From aa983a81d69edd6933b1817208ddae50b77ac211 Mon Sep 17 00:00:00 2001 From: Navanitha Sri Date: Sun, 5 Oct 2025 21:09:57 +0530 Subject: [PATCH 3/3] Add __init__.py to tests to fix Ruff namespace package error --- tests/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1