File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,10 +159,10 @@ def _test():
159159No problem, as long as the only output generated by the example is the
160160traceback itself. For example:
161161
162- >>> 1/0
162+ >>> [1, 2, 3].remove(42)
163163 Traceback (most recent call last):
164164 File "<stdin>", line 1, in ?
165- ZeroDivisionError: integer division or modulo by zero
165+ ValueError: list.remove(x): x not in list
166166 >>>
167167
168168Note that only the exception type and value are compared (specifically,
@@ -244,11 +244,11 @@ def _test():
244244executed, leading to this output in verbose mode:
245245
246246Running doctest.__doc__
247- Trying: 1/0
247+ Trying: [1, 2, 3].remove(42)
248248Expecting:
249249Traceback (most recent call last):
250250 File "<stdin>", line 1, in ?
251- ZeroDivisionError: integer division or modulo by zero
251+ ValueError: list.remove(x): x not in list
252252ok
253253Trying: x = 12
254254Expecting: nothing
Original file line number Diff line number Diff line change 11test_doctest
22Running doctest.__doc__
3- Trying: 1/0
3+ Trying: [1, 2, 3].remove(42)
44Expecting:
55Traceback (most recent call last):
66 File "<stdin>", line 1, in ?
7- ZeroDivisionError: integer division or modulo by zero
7+ ValueError: list.remove(x): x not in list
88ok
99Trying: x = 12
1010Expecting: nothing
You can’t perform that action at this time.
0 commit comments