[Python-3000-checkins] r53718 - python/branches/p3yk/Lib/test/test_doctest.py
guido.van.rossum
python-3000-checkins at python.org
Sat Feb 10 00:39:59 CET 2007
Author: guido.van.rossum
Date: Sat Feb 10 00:39:59 2007
New Revision: 53718
Modified:
python/branches/p3yk/Lib/test/test_doctest.py
Log:
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.
Modified: python/branches/p3yk/Lib/test/test_doctest.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_doctest.py (original)
+++ python/branches/p3yk/Lib/test/test_doctest.py Sat Feb 10 00:39:59 2007
@@ -325,7 +325,7 @@
... '''
>>> 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 @@
... 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:
More information about the Python-3000-checkins
mailing list