Skip to content

Commit

Permalink
fix test on py3
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminp committed Dec 29, 2009
1 parent ffa94b0 commit 60a9c69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/lib2to3/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ def run_2to3_capture(self, args, in_capture, out_capture, err_capture):

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())

0 comments on commit 60a9c69

Please sign in to comment.