From: Jason R. Coombs Date: Fri, 26 Jun 2015 02:42:24 +0000 (-0400) Subject: Issue #20387: Correct test to properly capture expectation. X-Git-Tag: v3.5.0b3~35^2^2^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b6d1cdda8e2160ac647b39776198bf48dc7e656f;p=thirdparty%2FPython%2Fcpython.git Issue #20387: Correct test to properly capture expectation. --- diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py index 00a2c2b30b5f..6506b671a1e1 100644 --- a/Lib/test/test_tokenize.py +++ b/Lib/test/test_tokenize.py @@ -1233,7 +1233,7 @@ class TestRoundtrip(TestCase): 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 @@ class TestRoundtrip(TestCase): 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])