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Â
unittest module 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Â
pytest tool requires a separate installation, but it seems to produce tests that are slightly simpler than those written with theunittestmodule. More importantly, the sophistication of the fixture concept lets us create tests for a wide variety of scenarios. - TheÂ
mock module, part of theunittestpackage, lets us create mock objects to better isolate the unit of code being tested. By isolating each piece of code, we can narrow our focus on being sure...