Doctests

[1]:
import doctest
doctest.testmod()

def add(a, b):
    '''
    This is a test:
    >>> add(2, 2)
    5
    '''
    return a + b