Author chris.jerdonek
Recipients asvetlov, brett.cannon, chris.jerdonek, docs@python, eli.bendersky, eric.araujo, ezio.melotti, georg.brandl, r.david.murray, sbt, terry.reedy, v+python
Date 2012-09-08.08:04:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Attached is a patch that adds to regrtest the ability to run doctests in both library modules and documentation files (specifically, in the non-test modules in Lib/ and in the *.rst files in Doc/).

The syntax to run all doctests is--

    python -m test --doctests --docdir <path-to-doc>

If --docdir is left out, only module doctests are run.  You can run the doctests for individual files and modules by including test names of the form "fdoc:library/builtins.rst" and "mdoc:html.parser" (for file doctests and module doctests, respectively).

Doctests for a module are only run if the module has a variable `_doctest_safe` that evaluates to True.

I haven't yet added a mechanism to mark a documentation file as "doctest safe" or to skip importing a library module entirely (when running all tests).
Date User Action Args
2012-09-08 08:04:27chris.jerdoneksetrecipients: + chris.jerdonek, brett.cannon, georg.brandl, terry.reedy, ezio.melotti, eric.araujo, v+python, r.david.murray, eli.bendersky, asvetlov, docs@python, sbt
2012-09-08 08:04:27chris.jerdoneksetmessageid: <>
2012-09-08 08:04:26chris.jerdoneklinkissue15629 messages
2012-09-08 08:04:26chris.jerdonekcreate