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


doctest, pytestdoctest: Docstring örneklerini doğruladef area(l, w):
"""
Finds the area given length and width and returns the result
>>> area(1, 1)
1
"""
return l + w
import doctest
doctest.testmod()
Failed example:
area(1,1)
Expected:
1
Got:
2
def area(l, w):
"""
Finds the area given length and width and returns the result
>>> area(1, 1)
1
"""
return l * w
import doctest
doctest.testmod()
Her şey TAMAM = hata yok, çıktı yok
Vaka Çalışması: Python ile Yazılım Geliştirme