Page MenuHomeDevCentral

Unit testing with pytest
ActivePublic

Authored by dereckson on Apr 11 2015, 15:17.
Referenced Files
F1770: Unit_testing_with_pytest
Apr 11 2015, 15:17
Subscribers
None
def add(a, b):
"""Adds two numbers."""
return a + b
def test_add():
"""Tests add method."""
assert add(0, 0) == 0
assert add(2, 0) == 2
assert add(0, 2) == 2
assert add(3, 4) == 7
assert add(-3, 2) == -1

Event Timeline

dereckson changed the title of this paste from untitled to Unit testing with pytest.
dereckson updated the paste's language from autodetect to .
dereckson updated the paste's language from to python.Apr 11 2015, 15:22
dereckson added a project: Tasacora.