[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:

http://sphinx.pocoo.org/ext/doctest.html?#directive-testsetup

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>
<http://bugs.python.org/issue15629>
_______________________________________


More information about the Python-bugs-list mailing list