Python doctests are cool. Let me start with a simple example:
def foo(): \"\"\" >>> foo() hello world \"\"\" print \"hello world\"
Here is a somewhat simpler way to do this: Just print a dummy string before the line that begins with the unknown output.
Like this:
def foo(): """ >>> print 'ignore'; foo() # doctest: +ELLIPSIS ignore... world """ print "hello world"