Vaka Çalışması: Python ile Yazılım Geliştirme
Mark Pedigo
Principal Data Scientist



# math.py
def add(a, b):
return a + b
# test_math.py
import pytest
def test_add():
assert add(2, 3) == 5
assert add(-1, 1) == 0
assert add(0, 0) == 0
assert add(-5, -7) == -12
Konsolda çalıştır:
pytest test_math.py===== test session starts ===== collected 1 item test_math_functions.py . [100%] ====== 1 passed in 0.03s ======
Vaka Çalışması: Python ile Yazılım Geliştirme