diff options
| author | Victor Stinner <vstinner@python.org> | 2020-04-23 03:03:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-23 03:03:24 +0200 |
| commit | 1def7754b7a41fe57efafaf5eff24cfa15353444 (patch) | |
| tree | 8fd9f9ddeaf9a66f92d1916b86901573afce0ccb /Lib/test/test_codeop.py | |
| parent | a25f3c4c8f7d4878918ce1d3d67db40ae255ccc6 (diff) | |
| download | cpython-git-1def7754b7a41fe57efafaf5eff24cfa15353444.tar.gz | |
bpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670)
* Rename PyConfig.use_peg to _use_peg_parser
* Document PyConfig._use_peg_parser and mark it a deprecated
* Mark -X oldparser option and PYTHONOLDPARSER env var as deprecated
in the documentation.
* Add use_old_parser() and skip_if_new_parser() to test.support
* Remove sys.flags.use_peg: use_old_parser() uses
_testinternalcapi.get_configs() instead.
* Enhance test_embed tests
* subprocess._args_from_interpreter_flags() copies -X oldparser
Diffstat (limited to 'Lib/test/test_codeop.py')
| -rw-r--r-- | Lib/test/test_codeop.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_codeop.py b/Lib/test/test_codeop.py index f1d74b1fb7..8c3e447200 100644 --- a/Lib/test/test_codeop.py +++ b/Lib/test/test_codeop.py @@ -4,12 +4,12 @@ """ import sys import unittest -from test.support import is_jython +from test import support from codeop import compile_command, PyCF_DONT_IMPLY_DEDENT import io -if is_jython: +if support.is_jython: def unify_callables(d): for n,v in d.items(): @@ -21,7 +21,7 @@ class CodeopTests(unittest.TestCase): def assertValid(self, str, symbol='single'): '''succeed iff str is a valid piece of code''' - if is_jython: + if support.is_jython: code = compile_command(str, "<input>", symbol) self.assertTrue(code) if symbol == "single": @@ -60,7 +60,7 @@ class CodeopTests(unittest.TestCase): av = self.assertValid # special case - if not is_jython: + if not support.is_jython: self.assertEqual(compile_command(""), compile("pass", "<input>", 'single', PyCF_DONT_IMPLY_DEDENT)) @@ -122,7 +122,7 @@ class CodeopTests(unittest.TestCase): av("def f():\n pass\n#foo\n") av("@a.b.c\ndef f():\n pass\n") - @unittest.skipIf(sys.flags.use_peg, "Pegen does not support PyCF_DONT_INPLY_DEDENT yet") + @support.skip_if_new_parser("Pegen does not support PyCF_DONT_INPLY_DEDENT yet") def test_incomplete(self): ai = self.assertIncomplete |
