Chapter 14. Fit and Finish – Unit Testing, Packaging, and Documentation

Beyond the Python language and its libraries, there are several other aspects to Python programming. We'll start by looking closely at the docstrings, which should be viewed as an essential ingredient in every package, module, class, and function definition. These have several purposes, one of which is to clarify what the object does.

In this chapter, we'll also look at the different approaches to unit testing. The doctest and unittest modules provide a comprehensive suite of tools. External tools like Nose are also widely used.

We'll also look at how we can leverage the logging module as part of a complete application. The Python logger is quite sophisticated as well, so we'll ...

Get Python Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.