diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/lib2to3/tests/test_parser.py | 4 | ||||
-rw-r--r-- | Lib/test/test_lib2to3.py | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/Lib/lib2to3/tests/test_parser.py b/Lib/lib2to3/tests/test_parser.py index 60e5d63..f32404c 100644 --- a/Lib/lib2to3/tests/test_parser.py +++ b/Lib/lib2to3/tests/test_parser.py @@ -166,7 +166,7 @@ class TestParserIdempotency(support.TestCase): encoding = tokenize.detect_encoding(fp.readline)[0] self.assertTrue(encoding is not None, "can't detect encoding for %s" % filepath) - with open(filepath, "r") as fp: + with open(filepath, "r", encoding=encoding) as fp: source = fp.read() try: tree = driver.parse_string(source) @@ -174,8 +174,6 @@ class TestParserIdempotency(support.TestCase): print('ParseError on file', filepath, err) continue new = str(tree) - if encoding: - new = new.encode(encoding) if diff(filepath, new): self.fail("Idempotency failed: %s" % filepath) diff --git a/Lib/test/test_lib2to3.py b/Lib/test/test_lib2to3.py index 24b2da6..df4c37b 100644 --- a/Lib/test/test_lib2to3.py +++ b/Lib/test/test_lib2to3.py @@ -9,7 +9,7 @@ from test.support import run_unittest def suite(): tests = unittest.TestSuite() loader = unittest.TestLoader() - for m in (test_fixers, test_pytree,test_util, test_refactor, test_parser, + for m in (test_fixers, test_pytree, test_util, test_refactor, test_parser, test_main_): tests.addTests(loader.loadTestsFromModule(m)) return tests |