Summary
Explore automated testing methods for Python object-oriented programs, including unittest, pytest, mock objects, and static analysis. Understand how to write unit and integration tests, use code coverage metrics, and apply test-driven development for robust and reliable software.
Recall
In this chapter, we’ve looked at a number of topics related to testing applications written in Python. These topics include the following:
-
We described the importance of unit testing and test-driven development as a way to be sure our software does what is expected.
-
We started by using the
unittestmodule because it’s part of the standard library and readily available. It seems a little wordy, but otherwise works well for confirming that our software works. -
The
pytesttool requires a separate installation, but it seems to produce tests that are slightly simpler ...