mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
fix test on py3
This commit is contained in:
parent
ffa94b0f02
commit
60a9c69c5e
1 changed files with 2 additions and 2 deletions
|
|
@ -25,12 +25,12 @@ class TestMain(unittest.TestCase):
|
|||
|
||||
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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue