Skip to content

Commit 5a32c40

Browse files
committed
Enable unit tests in GitHub Actions and add initial test cases for add_numbers function
1 parent c7912d6 commit 5a32c40

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/python.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ jobs:
2323
run: ruff check .
2424
- name: Check formatting with black
2525
run: black . --check --verbose
26-
# - name: Run unit tests
27-
# run: |
28-
# pytest
26+
- name: Run unit tests
27+
run: |
28+
pytest

tests/main_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from main import add_numbers
2+
3+
4+
def test_add_numbers():
5+
assert add_numbers(1, 2) == 3
6+
assert add_numbers(-1, 1) == 0
7+
assert add_numbers(0, 0) == 0
8+
assert add_numbers(-1, -1) == -2

0 commit comments

Comments
 (0)