Případová studie: Tvorba softwaru v Pythonu
Mark Pedigo
Principal Data Scientist


doctest, pytestdoctest: ověřování příkladů v docstrinzíchdef 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()
Vše v pořádku = žádné chybové zprávy, žádný výstup
Případová studie: Tvorba softwaru v Pythonu