doctest.testclass, or, for that matter,
doctest.testobj. However, you can run the doctests on a single function or class with
doctest.run_docstring_examples, like so:
"That's OK", I thought, "My function doesn't call any globals, so I'll just pass in an empty dictionary." Wrong.
run_doctstring_examplesactually needs your globals to find the object you're testing; you'll get
The docs say the function is "rarely useful", but I'm finding it very useful for an IPython Notebook-based interactive tutorial I'm hoping to work up shortly!
NameError: name 'myfunction' is not defined