Message170039
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:27 | chris.jerdonek | set | recipients:
+ 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:27 | chris.jerdonek | set | messageid: <1347091467.44.0.958598013156.issue15629@psf.upfronthosting.co.za> |
2012-09-08 08:04:26 | chris.jerdonek | link | issue15629 messages |
2012-09-08 08:04:26 | chris.jerdonek | create | |
|