Have epydoc automatically run doctests

66 Views Asked by At

I have a nightly epydoc job to generate documentation, but I would also like it to run my docstring tests. Does anyone know a way of having it automatically run docstring tests on every file it creates documentation for?

I tried inserting this code into the main block of epydoc

import doctest
doctest.testmod()

but to no avail. It looks for doctests in that block, and naturally there aren't any. I get this output:

1 items had no tests:
    __main__
0 tests in 1 items.
0 passed and 0 failed.
Test passed.
0

There are 0 best solutions below