From 60e23f4cfc306ae827bb0d00f13f2a51e244b235 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Wed, 14 Feb 2001 00:43:21 +0000 Subject: Change doctest exception example to one whose detail hasn't changed since 1.5.2. --- Lib/doctest.py | 8 ++++---- Lib/test/output/test_doctest | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Lib/doctest.py b/Lib/doctest.py index b761676..b3ef98b 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -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 "", 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 "", line 1, in ? -ZeroDivisionError: integer division or modulo by zero +ValueError: list.remove(x): x not in list ok Trying: x = 12 Expecting: nothing diff --git a/Lib/test/output/test_doctest b/Lib/test/output/test_doctest index 78f7a20..e2b1394 100644 --- a/Lib/test/output/test_doctest +++ b/Lib/test/output/test_doctest @@ -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 "", line 1, in ? -ZeroDivisionError: integer division or modulo by zero +ValueError: list.remove(x): x not in list ok Trying: x = 12 Expecting: nothing -- cgit v0.12