Python: Using doctest for Documentation

Python: Using doctest for Documentation

Python provides the useful ability to embed comments inside functions that are accessible from a Python shell. These are known as docstrings. A docstring provides the ability to embed not only information, but also code samples that are runnable.In this article, we will explore different ways to use doctest to develop documentation.

In this article by Greg Lee Turnquist, author of Python Testing Cookbook, we will cover:

* Documenting the basics
* Catching stack traces
* Running doctests from the command line
* Printing out all your documentation including a status report

Website Link Visit Link Here
Author: Packt Publishing

  • May 26, 2011 12:29 am
  • Related Tutorials

    Subscribe to get this amazing EBOOK FREE

    By subscribing to this newsletter you agree to our Privacy Policy

    Skip to content