GNU Info

Info Node: (python2.1-lib.info)What About Exceptions?

(python2.1-lib.info)What About Exceptions?


Next: Advanced Usage Prev: What's the Execution Context? Up: doctest
Enter node , (file) or (file)node

What About Exceptions?
----------------------

No problem, as long as the only output generated by the example is the
traceback itself.  For example:

     >>> [1, 2, 3].remove(42)
     Traceback (most recent call last):
       File "<stdin>", line 1, in ?
     ValueError: list.remove(x): x not in list
     >>>

Note that only the exception type and value are compared (specifically,
only the last line in the traceback).  The various "File" lines in
between can be left out (unless they add significantly to the
documentation value of the example).


automatically generated by info2www version 1.2.2.9