bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)
Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index 73178f3..124a279 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -8,6 +8,7 @@
import unittest
import operator
import struct
+import sys
from test import support
from test.support.script_helper import assert_python_failure
from test.support.script_helper import assert_python_ok
@@ -899,9 +900,10 @@
st = parser.expr(e)
st.compile()
+ @unittest.skipIf(sys.flags.use_peg, "Pegen does not trigger memory error with this many parenthesis")
def test_trigger_memory_error(self):
e = self._nested_expression(100)
- rc, out, err = assert_python_failure('-c', e)
+ rc, out, err = assert_python_failure('-Xoldparser', '-c', e)
# parsing the expression will result in an error message
# followed by a MemoryError (see #11963)
self.assertIn(b's_push: parser stack overflow', err)