summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_parser.py')
-rw-r--r--Lib/test/test_parser.py4
1 files changed, 3 insertions, 1 deletions
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 pickle
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 @@ class ParserStackLimitTestCase(unittest.TestCase):
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)