[Python-checkins] python/dist/src/Lib/test test_doctest2.py, 1.5, 1.6 test_doctest2.txt, 1.2, 1.3

dcjim at users.sourceforge.net dcjim at users.sourceforge.net
Wed Oct 13 16:15:34 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19639/Lib/test

Modified Files:
	test_doctest2.py test_doctest2.txt 
Log Message:
Fixed a small bug. doctest didn't handle unicode docstrings containing
non-ascii characters.


Index: test_doctest2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_doctest2.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- test_doctest2.py	30 Jul 2002 23:27:11 -0000	1.5
+++ test_doctest2.py	13 Oct 2004 14:15:32 -0000	1.6
@@ -1,17 +1,31 @@
-"""A module to test whether doctest recognizes some 2.2 features,
+# -*- coding: utf-8 -*-
+u"""A module to test whether doctest recognizes some 2.2 features,
 like static and class methods.
 
 >>> print 'yup'  # 1
 yup
+
+We include some (random) encoded (utf-8) text in the text surrounding
+the example.  It should be ignored:
+
+ЉЊЈЁЂ
+
 """
 
 from test import test_support
 
 class C(object):
-    """Class C.
+    u"""Class C.
 
     >>> print C()  # 2
     42
+
+
+    We include some (random) encoded (utf-8) text in the text surrounding
+    the example.  It should be ignored:
+
+        ЉЊЈЁЂ
+
     """
 
     def __init__(self):

Index: test_doctest2.txt
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_doctest2.txt,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- test_doctest2.txt	6 Aug 2004 22:02:59 -0000	1.2
+++ test_doctest2.txt	13 Oct 2004 14:15:32 -0000	1.3
@@ -5,3 +5,10 @@
   >>> import test.test_doctest
   >>> test.test_doctest.sillySetup
   True
+
+This test also has some (random) encoded (utf-8) unicode text:
+
+  ЉЊЈЁЂ
+
+This doesn't cause a problem in the tect surrounding the examples, but
+we include it here (in this test text file) to make sure. :)



More information about the Python-checkins mailing list