Doctest Mode: Summary of Commands
Running Doctest
- doctest-execute-buffer ("control-c control-c")
- Runs doctest on the current buffer, and displays the results in the
*doctest-output* buffer. By default, doctest is run
asynchronously, and once it completes, the *doctest-output*
buffer is displayed if there were any failed examples.
- doctest-execute-region ("control-c control-|")
- Runs doctest on the current region, and displays the results in the
*doctest-output* buffer.
- doctest-execute-buffer-with-diff ("control-c control-d")
- Runs doctest on the current region, and displays the results in the
*doctest-output* buffer. The REPORT_UDIFF flag is passed to
doctest, causing it describe failed examples using unified diffs.
This can be useful when examples with large outputs fail, to figure
out exactly what lines differ between the expected and the actual
output.
Updating Failed Examples
- doctest-replace-output ("control-c control-r")
- Replaces the expected output of the current example with the actual
output generated by the most recent run of doctest. It will confirm
the change that it plans to make. If used on an example that did
not fail, or that has been edited since doctest was last run,
doctest-replace-output will display an error message.
(Requires Python 2.4+.)
Navigating
- doctest-next-failure ("control-c control-n")
- Moves to the next failed example.
- doctest-prev-failure ("control-c control-p")
- Moves to the previous failed example.
- doctest-first-failure ("control-c control-a")
- Moves to the first failed example.
- doctest-last-failure ("control-c control-e")
- Moves to the last failed example.