nimi-python
nimi-python copied to clipboard
Consider using doctest
pytest has doctest integration: http://doc.pytest.org/en/latest/doctest.html
High-level, for code (most likely utilities) you can add little examples in the docstring which help document the utility in an unambiguous fashion. doctest will turn those snippets into tests, ensuring what is written is true.
E.g.
def add(x, y):
"""Adds the numbers.
>>> add(1, 2)
4
"""
Would become a failing test at test time.