| 1 |
Custom doctest parsers |
| 2 |
---------------------- |
| 3 |
|
| 4 |
zc.customdoctests provides a little bit of help with creating custom |
| 5 |
doctest parsers that work pretty muct like regular doctests, but that |
| 6 |
use an alternate means of evaluating examples. To use it, you call |
| 7 |
zc.customdoctests.DocTestParser and pass any of the following options: |
| 8 |
|
| 9 |
ps1 |
| 10 |
The first-line prompt, which defaultd to ``'>>>'``. |
| 11 |
|
| 12 |
This must be a regular expression that matches exactly 3 characters. |
| 13 |
|
| 14 |
(Note that you can't override the second-line prompt.) |
| 15 |
|
| 16 |
comment_prefix |
| 17 |
The comment prefix regular expression, which defaults to '#'. |
| 18 |
|
| 19 |
transform |
| 20 |
A function used to transform example source, which defaults to a |
| 21 |
no-operation function. |
| 22 |
|
| 23 |
The js module provides support for using JavaScript in doctests using |
| 24 |
`python-spidermonkey |
| 25 |
<http://pypi.python.org/pypi/python-spidermonkey>`_. It provides some |
| 26 |
examples of defining custom doctest parsers. |