Using doctest is nice, but it is not very good for large test suites.

The unittest module is another standard module that provides a much more powerful way to write tests and despite its name it can be used to write integration and acceptance tests just as well as unittests.