[Zope3-checkins] SVN: zope.testing/branches/regebro-python3-reloaded/src/zope/testing/testrunner/ More Python 3 fixes.

Lennart Regebro regebro at gmail.com
Sun Dec 13 16:20:33 EST 2009


Log message for revision 106472:
  More Python 3 fixes.
  

Changed:
  U   zope.testing/branches/regebro-python3-reloaded/src/zope/testing/testrunner/formatter.py
  U   zope.testing/branches/regebro-python3-reloaded/src/zope/testing/testrunner/runner.py
  U   zope.testing/branches/regebro-python3-reloaded/src/zope/testing/testrunner/tests.py

-=-
Modified: zope.testing/branches/regebro-python3-reloaded/src/zope/testing/testrunner/formatter.py
===================================================================
--- zope.testing/branches/regebro-python3-reloaded/src/zope/testing/testrunner/formatter.py	2009-12-13 21:11:11 UTC (rev 106471)
+++ zope.testing/branches/regebro-python3-reloaded/src/zope/testing/testrunner/formatter.py	2009-12-13 21:20:33 UTC (rev 106472)
@@ -380,12 +380,12 @@
         # Python version:
         if sys.version_info >= (3,):
             import io
-            wrapped_stdout_error = io.UnsupportedOperation
+            expected_exceptions = (curses.error, TypeError, io.UnsupportedOperation)
         else:
-            wrapped_stdout_error = TypeError
+            expected_exceptions = (curses.error, TypeError)
         try:
             curses.setupterm()
-        except (curses.error, wrapped_stdout_error):
+        except expected_exceptions:
             # You get curses.error when $TERM is set to an unknown name
             pass
         else:

Modified: zope.testing/branches/regebro-python3-reloaded/src/zope/testing/testrunner/runner.py
===================================================================
--- zope.testing/branches/regebro-python3-reloaded/src/zope/testing/testrunner/runner.py	2009-12-13 21:11:11 UTC (rev 106471)
+++ zope.testing/branches/regebro-python3-reloaded/src/zope/testing/testrunner/runner.py	2009-12-13 21:20:33 UTC (rev 106472)
@@ -492,6 +492,8 @@
     """Keeps stdout around for later processing,"""
 
     def write(self, out):
+        if not isinstance(out, str): # It's binary, which means it's Python 3
+            out = out.decode()
         if not _is_dots(out):
             self.stdout.append(out)
 
@@ -523,6 +525,8 @@
     done = property(lambda self: self._done, _set_done)
 
     def write(self, out):
+        if not isinstance(out, str): # It's binary, which means it's Python 3
+            out = out.decode()
         if _is_dots(out):
             self.queue.put((self.layer_name, out.strip()))
         else:

Modified: zope.testing/branches/regebro-python3-reloaded/src/zope/testing/testrunner/tests.py
===================================================================
--- zope.testing/branches/regebro-python3-reloaded/src/zope/testing/testrunner/tests.py	2009-12-13 21:11:11 UTC (rev 106471)
+++ zope.testing/branches/regebro-python3-reloaded/src/zope/testing/testrunner/tests.py	2009-12-13 21:20:33 UTC (rev 106472)
@@ -150,10 +150,10 @@
         #'testrunner-debugging.txt',
         #'testrunner-edge-cases.txt',
         #'testrunner-errors.txt',
-        'testrunner-layers-buff.txt',
+        #'testrunner-layers-buff.txt',
         #'testrunner-layers-ntd.txt',
         #'testrunner-layers.txt',
-        #'testrunner-layers-api.txt',
+        'testrunner-layers-api.txt',
         #'testrunner-progress.txt',
         #'testrunner-colors.txt',
         #'testrunner-simple.txt',



More information about the Zope3-Checkins mailing list