[Python-checkins] r77105 - python/branches/py3k/Lib/lib2to3/tests/test_main.py

benjamin.peterson python-checkins at python.org
Tue Dec 29 01:37:04 CET 2009


Author: benjamin.peterson
Date: Tue Dec 29 01:37:04 2009
New Revision: 77105

Log:
fix test on py3

Modified:
   python/branches/py3k/Lib/lib2to3/tests/test_main.py

Modified: python/branches/py3k/Lib/lib2to3/tests/test_main.py
==============================================================================
--- python/branches/py3k/Lib/lib2to3/tests/test_main.py	(original)
+++ python/branches/py3k/Lib/lib2to3/tests/test_main.py	Tue Dec 29 01:37:04 2009
@@ -25,12 +25,12 @@
 
     def test_unencodable_diff(self):
         input_stream = io.StringIO("print 'nothing'\nprint u'über'\n")
-        out = io.StringIO()
+        out = io.BytesIO()
         out_enc = codecs.getwriter("ascii")(out)
         err = io.StringIO()
         ret = self.run_2to3_capture(["-"], input_stream, out_enc, err)
         self.assertEqual(ret, 0)
-        output = out.getvalue()
+        output = out.getvalue().decode("ascii")
         self.assertTrue("-print 'nothing'" in output)
         self.assertTrue("WARNING: couldn't encode <stdin>'s diff for "
                         "your terminal" in err.getvalue())


More information about the Python-checkins mailing list