]> granicus.if.org Git - python/commitdiff
Teach doctest about newer "(most recent call last)" traceback spelling.
authorTim Peters <tim.peters@gmail.com>
Tue, 13 Feb 2001 20:54:42 +0000 (20:54 +0000)
committerTim Peters <tim.peters@gmail.com>
Tue, 13 Feb 2001 20:54:42 +0000 (20:54 +0000)
Lib/doctest.py
Lib/test/output/test_doctest

index 10b0767196d9a466e309f75c1c7a20fedc190352..b761676fa3f55983ac59bae5e6afa8b8c5000572 100644 (file)
@@ -160,7 +160,7 @@ No problem, as long as the only output generated by the example is the
 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
     >>>
@@ -246,7 +246,7 @@ executed, leading to this output in verbose mode:
 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
@@ -489,7 +489,8 @@ def _run_examples_inner(out, fakeout, examples, globs, verbose, name):
             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'
index 2eee5a4e56fb08898484950075c1243446f6e1de..78f7a20ebd7950877ff58b029e627b7a7d06ab11 100644 (file)
@@ -2,7 +2,7 @@ test_doctest
 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