Unittest - adding a doctest suite to unittest.main

Paul Moore p.f.moore at gmail.com
Tue Oct 14 15:48:40 CEST 2008


My normal testing consists of a tests.py script using unittest, with
the basic

if __name__ == '__main__':
    unittest.main()

incantation to get things going.

But I now want to incorporate some other tests (specifically, a text
file containing doctests) and I find that there is no gradual process
for expanding on unittest.main. It seems that I need to jump straight
into the depths of test suites, test loaders, and the rest, and build
my main routine from those. I've looked at the source for
unittest.main, and it doesn't look particularly customisable.

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

Thanks,
Paul.



More information about the Python-list mailing list