---

Testing in Python using doctest

[ Thanks to Naheed
for this link. ]

“Coding a test harness for doctest: The doctest module supports
creating objects, invoking methods, and checking results. With this
recipe, we will explore this in more detail.

“An important aspect of doctest is that it finds individual
instances of docstrings, and runs them in a local context.
Variables declared in one docstring cannot be used in another
docstring.”

Complete
Story

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis