[Python-3000-checkins] r55171 - python/branches/p3yk/Lib/test/test_doctest.py

guido.van.rossum python-3000-checkins at python.org
Mon May 7 19:21:31 CEST 2007


Author: guido.van.rossum
Date: Mon May  7 19:21:26 2007
New Revision: 55171

Modified:
   python/branches/p3yk/Lib/test/test_doctest.py
Log:
Fix two tests that were previously depending on significant spaces
at the end of a line (and before that on Python 2.x print behavior
that has no exact equivalent in 3.0).


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	Mon May  7 19:21:26 2007
@@ -34,8 +34,8 @@
     >>> sc = SampleClass(3)
     >>> for i in range(10):
     ...     sc = sc.double()
-    ...     print(sc.get(), end=' ')
-    6 12 24 48 96 192 384 768 1536 3072
+    ...     print(' ', sc.get(), sep='', end='')
+     6 12 24 48 96 192 384 768 1536 3072
     """
     def __init__(self, val):
         """
@@ -1460,12 +1460,12 @@
 
     >>> def f(x): r'''
     ...     >>> for x in range(10): # doctest: +ELLIPSIS
-    ...     ...     print(x, end=' ')
-    ...     0 1 2 ... 9
+    ...     ...     print(' ', x, end='', sep='')
+    ...      0 1 2 ... 9
     ...
     ...     >>> for x in range(10):
-    ...     ...     print(x, end=' ') # doctest: +ELLIPSIS
-    ...     0 1 2 ... 9
+    ...     ...     print(' ', x, end='', sep='') # doctest: +ELLIPSIS
+    ...      0 1 2 ... 9
     ...     '''
     >>> test = doctest.DocTestFinder().find(f)[0]
     >>> doctest.DocTestRunner(verbose=False).run(test)


More information about the Python-3000-checkins mailing list