mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Change doctest exception example to one whose detail hasn't changed since 1.5.2.
This commit is contained in:
parent
0eea16633a
commit
60e23f4cfc
2 changed files with 6 additions and 6 deletions
|
@ -159,10 +159,10 @@ WHAT ABOUT EXCEPTIONS?
|
|||
No problem, as long as the only output generated by the example is the
|
||||
traceback itself. For example:
|
||||
|
||||
>>> 1/0
|
||||
>>> [1, 2, 3].remove(42)
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 1, in ?
|
||||
ZeroDivisionError: integer division or modulo by zero
|
||||
ValueError: list.remove(x): x not in list
|
||||
>>>
|
||||
|
||||
Note that only the exception type and value are compared (specifically,
|
||||
|
@ -244,11 +244,11 @@ If you execute this very file, the examples above will be found and
|
|||
executed, leading to this output in verbose mode:
|
||||
|
||||
Running doctest.__doc__
|
||||
Trying: 1/0
|
||||
Trying: [1, 2, 3].remove(42)
|
||||
Expecting:
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 1, in ?
|
||||
ZeroDivisionError: integer division or modulo by zero
|
||||
ValueError: list.remove(x): x not in list
|
||||
ok
|
||||
Trying: x = 12
|
||||
Expecting: nothing
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
test_doctest
|
||||
Running doctest.__doc__
|
||||
Trying: 1/0
|
||||
Trying: [1, 2, 3].remove(42)
|
||||
Expecting:
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 1, in ?
|
||||
ZeroDivisionError: integer division or modulo by zero
|
||||
ValueError: list.remove(x): x not in list
|
||||
ok
|
||||
Trying: x = 12
|
||||
Expecting: nothing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue