diff options
Diffstat (limited to 'Lib/test/support/__init__.py')
| -rw-r--r-- | Lib/test/support/__init__.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 9f43b4071c..4fe247aeb9 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -3454,3 +3454,13 @@ def wait_process(pid, *, exitcode, timeout=None): # sanity check: it should not fail in practice if pid2 != pid: raise AssertionError(f"pid {pid2} != pid {pid}") + + +def use_old_parser(): + import _testinternalcapi + config = _testinternalcapi.get_configs() + return (config['config']['_use_peg_parser'] == 0) + + +def skip_if_new_parser(msg): + return unittest.skipIf(not use_old_parser(), msg) |
