5.1.1. Unit testing
pytest
for testing
- include unit tests for functions, preferable table-driven
def addition(x, y):
return x+y
import pytest
@pytest.mark.parametrize("x, y, z", [(1, 1, 2), (1, -1, 0)])
def test_eval(x, y, z):
assert addition(x, y) == z
$ pytest