Book Image

Python Essentials

By : Steven F. Lott
Book Image

Python Essentials

By: Steven F. Lott

Overview of this book

Table of Contents (22 chapters)
Python Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 focus on a few of the essential features.

We'll examine some tools that are used to build Python documentation from the embedded docstring comments. Using tools to extract documentation allows us to focus on writing proper code and deriving the reference...