doctest tool is flexible and extremely easy to use but, as we've noticed, it falls somewhat short when it comes to writing disciplined tests. That's not to say that it's impossible; we've seen that we can write well-behaved, isolated tests in
doctest. The problem is that
doctest doesn't do any of that work for us. Fortunately, we have another testing tool on hand, a tool that requires a bit more structure in our tests, and provides a bit more support:
unittest module was designed based on the requirements of unit testing, but it's not actually limited to that. You can use unit test for integration and system testing, too.
unittest is a part of the Python standard library; ...