ipython-doctestmagic

Run and debug doctest in IPython

Stars
6
Committers
3

%doctest [-n NAME] [-v] [-x] object [object ...]

Run doctest of given objects.

Example::

%doctest some_object other_object # run doctest for several objects %doctest -v some_object # verbose ouput %doctest -x some_object # debug doctest

Use the cell magic version of this magic command (%%doctest) to write doctest directly in IPython shell.

positional arguments: object Doctest is ran against docstrings of this object.

optional arguments: -n NAME, --name NAME See :func:doctest.run_docstring_examples. -f, --file The object to be tested is a (path to a) file -o OPTION, --options OPTION Pass on options to doctest -v, --verbose See :func:doctest.run_docstring_examples. -x, --stop Stop testing after the first error or failure. When this option is used, the error is stored in IPython shell so that you can debug it by turning on pdb flag before doctest (see %pdb) or use %debug magic command afterward.