]> granicus.if.org Git - python/commitdiff
Backport a fix from Py3k for a potentially misleading example
authorNick Coghlan <ncoghlan@gmail.com>
Sat, 12 Jun 2010 13:45:37 +0000 (13:45 +0000)
committerNick Coghlan <ncoghlan@gmail.com>
Sat, 12 Jun 2010 13:45:37 +0000 (13:45 +0000)
Doc/library/doctest.rst

index edf4a701e1f024f6ba8224f18c79453abcc73a7d..d587c7507d210395c7466e22863aac07f38b7e0c 100644 (file)
@@ -576,13 +576,13 @@ doctest decides whether actual output matches an example's expected output:
    both these variations will work regardless of whether the test is run under
    Python 2.7 or Python 3.2 (or later versions):
 
-      >>> raise ValueError('message') #doctest: +IGNORE_EXCEPTION_DETAIL
+      >>> raise CustomError('message') #doctest: +IGNORE_EXCEPTION_DETAIL
       Traceback (most recent call last):
-      ValueError: message
+      CustomError: message
 
-      >>> raise ValueError('message') #doctest: +IGNORE_EXCEPTION_DETAIL
+      >>> raise CustomError('message') #doctest: +IGNORE_EXCEPTION_DETAIL
       Traceback (most recent call last):
-      builtin.ValueError: message
+      my_module.CustomError: message
 
    Note that :const:`ELLIPSIS` can also be used to ignore the
    details of the exception message, but such a test may still fail based