[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope3-checkins
Subject:    [Zope3-checkins] SVN: zope.testing/trunk/src/zope/testing/ found
From:       Christian Zagrodnick <cz () gocept ! com>
Date:       2007-05-23 17:30:17
Message-ID: 20070523173017.4F66D2033D4 () mail ! zope ! org
[Download RAW message or body]

Log message for revision 75911:
  found another unicode related bug which occured when one test returned a unicode \
and a subsequent test a normal string with unicode chars

Changed:
  U   zope.testing/trunk/src/zope/testing/doctest.py
  U   zope.testing/trunk/src/zope/testing/testrunner-errors.txt
  U   zope.testing/trunk/src/zope/testing/testrunner-ex/unicode.txt

-=-
Modified: zope.testing/trunk/src/zope/testing/doctest.py
===================================================================
--- zope.testing/trunk/src/zope/testing/doctest.py	2007-05-23 15:37:21 UTC (rev \
                75910)
+++ zope.testing/trunk/src/zope/testing/doctest.py	2007-05-23 17:30:16 UTC (rev \
75911) @@ -282,6 +282,11 @@
         if hasattr(self, "softspace"):
             del self.softspace
 
+    def write(self, value):
+        if isinstance(value, unicode):
+            value = value.encode('utf8')
+        StringIO.write(self, value)
+
 # Worst-case linear-time ellipsis matching.
 def _ellipsis_match(want, got):
     """
@@ -1353,7 +1358,6 @@
             except:
                 exception = sys.exc_info()
                 self.debugger.set_continue() # ==== Example Finished ====
-
             got = self._fakeout.getvalue()  # the actual output
             self._fakeout.truncate(0)
             outcome = FAILURE   # guilty until proved innocent or insane

Modified: zope.testing/trunk/src/zope/testing/testrunner-errors.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-errors.txt	2007-05-23 15:37:21 UTC \
                (rev 75910)
+++ zope.testing/trunk/src/zope/testing/testrunner-errors.txt	2007-05-23 17:30:16 UTC \
(rev 75911) @@ -906,7 +906,7 @@
     Running tests at level 1
     Running unit tests:
       Running:
-    ..
+    ...
     <BLANKLINE>
     Failure testrunner-ex/unicode.txt
     Failed doctest test for unicode.txt
@@ -930,7 +930,7 @@
         'xyz'
     <BLANKLINE>
     <BLANKLINE>
-      Ran 2 tests with 1 failures and 0 errors in N.NNN seconds.
+      Ran 3 tests with 1 failures and 0 errors in N.NNN seconds.
     True
 
  

Modified: zope.testing/trunk/src/zope/testing/testrunner-ex/unicode.txt
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner-ex/unicode.txt	2007-05-23 15:37:21 \
                UTC (rev 75910)
+++ zope.testing/trunk/src/zope/testing/testrunner-ex/unicode.txt	2007-05-23 17:30:16 \
UTC (rev 75911) @@ -10,9 +10,18 @@
     >>> print get_unicode()
     oink
 
+There was another unicode bug. When a function returned unicode some internal
+state switched. This broke any further test not returning unicode but a plain
+string with unicode characters. Make sure this works now::
+
+    >>> get_unicode()
+    u'foo \u2014 bar'
+    >>> print get_unicode()
+    foo — bar
+
+
 Get some normal output as well::
 
     >>> 'xyz'
     123
 
-

_______________________________________________
Zope3-Checkins mailing list
Zope3-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope3-checkins


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic