diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-02-13 20:54:42 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-02-13 20:54:42 (GMT) |
commit | ea4f931cb9c8c821c4f99011461f300caeffaad0 (patch) | |
tree | 0cc41bedd6d45d3a164c55f6f94774c1ce1bf3e8 /Lib | |
parent | 467d723bd728e73d425c143b9ed6e8301a3d7721 (diff) | |
download | cpython-ea4f931cb9c8c821c4f99011461f300caeffaad0.zip cpython-ea4f931cb9c8c821c4f99011461f300caeffaad0.tar.gz cpython-ea4f931cb9c8c821c4f99011461f300caeffaad0.tar.bz2 |
Teach doctest about newer "(most recent call last)" traceback spelling.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/doctest.py | 7 | ||||
-rw-r--r-- | Lib/test/output/test_doctest | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py index 10b0767..b761676 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -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' diff --git a/Lib/test/output/test_doctest b/Lib/test/output/test_doctest index 2eee5a4..78f7a20 100644 --- a/Lib/test/output/test_doctest +++ b/Lib/test/output/test_doctest @@ -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 |