[TIP] coverage.py with doctest.testfile

Benji York benji at benjiyork.com
Tue Mar 6 06:53:03 PST 2007

David Montgomery wrote:
> I have coverage.py working with doctest.testmod(), but
> not with doctest.testfile().  The external tests run, but
> coverage.py doesn't pick up the lines executed by the
> text file.
> Anyone on the list have experience getting this working?

I'm afraid I don't have time to look into the details at the moment, but 
zope.testing's test runner uses coverage.py with whole-file doctests, so 
you might get some insight from that code.  The code is browsable at: 

(I'm assuming you don't want coverage of the doctest itself, but the 
code it invokes.)
Benji York

More information about the testing-in-python mailing list