Unittest - adding a doctest suite to unittest.main

Duncan Booth duncan.booth at invalid.invalid
Tue Oct 14 11:09:44 EDT 2008


Paul  Moore <p.f.moore at gmail.com> wrote:

> Just before I start diving into the gory details, have I missed a
> simple way of adding an additional doctest.DocFileSuite to
> unittest.main?

Create a function named test_suite which creates a test suite containing 
all your tests including the doctests. Pass that to main as the defaultTest 
argument.

Google for "DocFileSuite unittest.main" and you should find plenty of 
examples. e.g. http://mail.zope.org/pipermail/zope3-checkins/2008-
May/029732.html or 
http://svn.nuxeo.org/trac/pub/browser/Python/CalCore/branches/snowsprint-
eventprovider/src/calcore/tests/test_cal.py?rev=50936

-- 
Duncan Booth http://kupuguy.blogspot.com



More information about the Python-list mailing list