Summary
We have finally covered the most important topic in Python programming: automated testing. After proving its importance and considering best design principles, we discussed the basic API for two popular Python 3 test frameworks. In particular we covered:
Unit testing
Test-driven development
The
unittest
moduleAssertion methods and code setup/cleanup
The
py.test
frameworkCode coverage
In the next chapter, we'll wrap up our learning with a compendium of object-oriented frameworks and libraries that work in Python 3.