diff options
Diffstat (limited to 'Lib')
| -rw-r--r-- | Lib/test/test_peg_parser.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/test/test_peg_parser.py b/Lib/test/test_peg_parser.py index ea4afa6e17..43d30bae84 100644 --- a/Lib/test/test_peg_parser.py +++ b/Lib/test/test_peg_parser.py @@ -699,7 +699,7 @@ class ASTGenerationTest(unittest.TestCase): self.maxDiff = None for source in TEST_SOURCES: actual_ast = peg_parser.parse_string(source) - expected_ast = ast.parse(source) + expected_ast = peg_parser.parse_string(source, oldparser=True) self.assertEqual( ast.dump(actual_ast, include_attributes=True), ast.dump(expected_ast, include_attributes=True), @@ -721,12 +721,11 @@ class ASTGenerationTest(unittest.TestCase): f"Actual error message does not match expexted for {source}" ) - @support.skip_if_new_parser("This tests nothing for now, since compile uses pegen as well") @unittest.expectedFailure def test_correct_but_known_to_fail_ast_generation_on_source_files(self) -> None: for source in GOOD_BUT_FAIL_SOURCES: actual_ast = peg_parser.parse_string(source) - expected_ast = ast.parse(source) + expected_ast = peg_parser.parse_string(source, oldparser=True) self.assertEqual( ast.dump(actual_ast, include_attributes=True), ast.dump(expected_ast, include_attributes=True), @@ -736,7 +735,7 @@ class ASTGenerationTest(unittest.TestCase): def test_correct_ast_generation_without_pos_info(self) -> None: for source in GOOD_BUT_FAIL_SOURCES: actual_ast = peg_parser.parse_string(source) - expected_ast = ast.parse(source) + expected_ast = peg_parser.parse_string(source, oldparser=True) self.assertEqual( ast.dump(actual_ast), ast.dump(expected_ast), @@ -752,7 +751,7 @@ class ASTGenerationTest(unittest.TestCase): def test_correct_ast_generatrion_eval(self) -> None: for source in EXPRESSIONS_TEST_SOURCES: actual_ast = peg_parser.parse_string(source, mode='eval') - expected_ast = ast.parse(source, mode='eval') + expected_ast = peg_parser.parse_string(source, mode='eval', oldparser=True) self.assertEqual( ast.dump(actual_ast, include_attributes=True), ast.dump(expected_ast, include_attributes=True), |
