summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-09 23:39:59 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-09 23:39:59 (GMT)
commite0192e576f883bc495f2b731325173fd9d945d46 (patch)
tree51265acfc53d01f17a3a44f7e0abb5af2dca68c8 /Lib/test
parent79f554368533d069545cea148173c44fd056836d (diff)
downloadcpython-e0192e576f883bc495f2b731325173fd9d945d46.zip
cpython-e0192e576f883bc495f2b731325173fd9d945d46.tar.gz
cpython-e0192e576f883bc495f2b731325173fd9d945d46.tar.bz2
Fix the remaining doctest failures.
One was a modified line that was echoed in an exception; the other two were softspace problems, fixed clumsily but effectively.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_doctest.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py
index f3ee247..087b340 100644
--- a/Lib/test/test_doctest.py
+++ b/Lib/test/test_doctest.py
@@ -325,7 +325,7 @@ continuation lines, then `DocTest` will raise a ValueError:
... '''
>>> parser.get_doctest(docstring, globs, 'some_test', 'filename', 0)
Traceback (most recent call last):
- ValueError: line 2 of the docstring for some_test has inconsistent leading whitespace: '... 2)'
+ ValueError: line 2 of the docstring for some_test has inconsistent leading whitespace: '... 2))'
If there's no blank space after a PS1 prompt ('>>>'), then `DocTest`
will raise a ValueError:
@@ -1028,14 +1028,18 @@ output to match any substring in the actual output:
... also matches nothing:
- >>> for i in range(100):
- ... print(i**2, end=' ') #doctest: +ELLIPSIS
- 0 1...4...9 16 ... 36 49 64 ... 9801
+ >>> if 1:
+ ... for i in range(100):
+ ... print(i**2, end=' ') #doctest: +ELLIPSIS
+ ... print('!')
+ 0 1...4...9 16 ... 36 49 64 ... 9801 !
... can be surprising; e.g., this test passes:
- >>> for i in range(21): #doctest: +ELLIPSIS
- ... print(i, end=' ')
+ >>> if 1: #doctest: +ELLIPSIS
+ ... for i in range(20):
+ ... print(i, end=' ')
+ ... print(20)
0 1 2 ...1...2...0
Examples from the docs: