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 <rep...@bugs.python.org>
<http://bugs.python.org/issue15629>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to