[docs] [issue15629] Add to regrtest the ability to run Lib and Doc doctests

Chris Jerdonek report at bugs.python.org
Tue Sep 11 06:07:04 CEST 2012

Chris Jerdonek added the comment:

> The reason is that Sphinx has extra facilities that allow docttests to work without having to have "boilerplate" code in places where doing so would disrupt the narrative flow.

Yes, this seems to be true.  Sphinx has a "testsetup" directive which lets you avoid adding boilerplate to interactive examples:


I did a quick search, though, and it looks like this is used in only 7 documentation files out of the 430+ -- one of which is library/turtle.rst. :)

Similarly, the "testcode" directive (a variant of the doctest format) seems to be used in just 5 files.  In any case, we could still benefit from running the doctests from regrtest that don't require use of testsetup.


Python tracker <report at bugs.python.org>

More information about the docs mailing list