The normal doctest-mode execution functionality is also available. If you type "control-c control-c" to run doctest-execute, then all examples in the current docstring will be executed. (Note: examples in other docstrings will not be run.) |
def x_intercept(m, b): """ Return the x intercept of the line y=m*x+b. >>> x_intercept(3, 6) -2.0 >>> x_intercept(-4, 2) 0.5 >>> x_intercept(-2, 0) 0.0. """ return -float(b)/m ISO8---Emacs: mytest.py (Python[Doctest] MMM Font)----L9--All-- All doctest examples passed! |