traceback itself. For example:
>>> 1/0
- Traceback (innermost last):
+ Traceback (most recent call last):
File "<stdin>", line 1, in ?
ZeroDivisionError: integer division or modulo by zero
>>>
Running doctest.__doc__
Trying: 1/0
Expecting:
-Traceback (innermost last):
+Traceback (most recent call last):
File "<stdin>", line 1, in ?
ZeroDivisionError: integer division or modulo by zero
ok
state = OK
except:
# See whether the exception was expected.
- if want.find("Traceback (innermost last):\n") == 0:
+ if want.find("Traceback (innermost last):\n") == 0 or \
+ want.find("Traceback (most recent call last):\n") == 0:
# Only compare exception type and value - the rest of
# the traceback isn't necessary.
want = want.split('\n')[-2] + '\n'
Running doctest.__doc__
Trying: 1/0
Expecting:
-Traceback (innermost last):
+Traceback (most recent call last):
File "<stdin>", line 1, in ?
ZeroDivisionError: integer division or modulo by zero
ok