mirror of
https://github.com/python/cpython.git
synced 2025-08-18 07:41:05 +00:00
Backport a fix from Py3k for a potentially misleading example
This commit is contained in:
parent
f084aed3b0
commit
10f08f9599
1 changed files with 4 additions and 4 deletions
|
@ -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
|
both these variations will work regardless of whether the test is run under
|
||||||
Python 2.7 or Python 3.2 (or later versions):
|
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):
|
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):
|
Traceback (most recent call last):
|
||||||
builtin.ValueError: message
|
my_module.CustomError: message
|
||||||
|
|
||||||
Note that :const:`ELLIPSIS` can also be used to ignore the
|
Note that :const:`ELLIPSIS` can also be used to ignore the
|
||||||
details of the exception message, but such a test may still fail based
|
details of the exception message, but such a test may still fail based
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue