changeset: 96708:49323e5f6391 branch: 3.4 user: Jason R. Coombs date: Thu Jun 25 22:42:24 2015 -0400 files: Lib/test/test_tokenize.py description: Issue #20387: Correct test to properly capture expectation. diff -r b784c842a63c -r 49323e5f6391 Lib/test/test_tokenize.py --- a/Lib/test/test_tokenize.py Sat Jun 20 19:52:22 2015 -0400 +++ b/Lib/test/test_tokenize.py Thu Jun 25 22:42:24 2015 -0400 @@ -1233,7 +1233,7 @@ def roundtrip(self, code): if isinstance(code, str): code = code.encode('utf-8') - return untokenize(tokenize(BytesIO(code).readline)) + return untokenize(tokenize(BytesIO(code).readline)).decode('utf-8') def test_indentation_semantics_retained(self): """ @@ -1241,7 +1241,7 @@ the semantic meaning of the indentation remains consistent. """ code = "if False:\n\tx=3\n\tx=3\n" - codelines = roundtrip(code).split('\n') + codelines = self.roundtrip(code).split('\n') self.assertEqual(codelines[1], codelines[2])