]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40334: Fix test_peg_parser to actually use the old parser (GH-19778)
authorLysandros Nikolaou <lisandrosnik@gmail.com>
Wed, 29 Apr 2020 22:53:30 +0000 (01:53 +0300)
committerGitHub <noreply@github.com>
Wed, 29 Apr 2020 22:53:30 +0000 (23:53 +0100)
commit69e802ed812e38cb68a4ab74af64b4f719b6cc78
tree1c05825a7f7ee032471c4cdc8bb60c648b1f491e
parent360371f79c48f15bbcee7aeecacf97a899913b25
bpo-40334: Fix test_peg_parser to actually use the old parser (GH-19778)

Now that the default parser is the new PEG parser, ast.parse uses it, which means that we don't actually test something in test_peg_parser. This commit introduces a new keyword argument (`oldparser`) for `_peg_parser.parse_string` for specifying that a string needs to be parsed with the old parser. This keyword argument is used in the tests to actually compare the ASTs the new parser generates with those generated by the old parser.
Lib/test/test_peg_parser.py
Modules/_peg_parser.c