Testing in Python using doctest
May 16, 2011, 05:11 (0 Talkback[s])
(Other stories by Greg Lee Turnquist)
[ 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
Related Stories:
- Fourth alpha of Python 3.2 released(Nov 17, 2010)
- Python: Unit Testing with Doctest(Sep 21, 2010)
- Metasploit Gains Further Commercial Adoption(Feb 18, 2010)
- Another ten essential Python tips(Feb 16, 2010)
- Ten essential Python tips for beginners(Jan 22, 2010)
- Keeping score in test-driven development with Python, PyLint, unittest, doctest,(Nov 20, 2009)