Skip to content

Commit a9ffeaf

Browse files
committed
Add template calculator tests
1 parent ad06768 commit a9ffeaf

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎tests/test_calculator.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import pytest
2+
3+
from src.python_dev import add, divide
4+
5+
6+
def test_add_returns_sum() -> None:
7+
assert add(2, 3) == 5
8+
9+
10+
def test_divide_returns_quotient() -> None:
11+
assert divide(10, 2) == 5
12+
13+
14+
def test_divide_rejects_zero_denominator() -> None:
15+
with pytest.raises(ValueError, match="denominator must not be zero"):
16+
divide(10, 0)

0 commit comments

Comments
 (0)