summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_parser.py
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-04-22 22:29:27 (GMT)
committerGitHub <noreply@github.com>2020-04-22 22:29:27 (GMT)
commitc5fc15685202cda73f7c3f5c6f299b0945f58508 (patch)
tree7624ae45b95f2812e801c5879bdbdcb796f570a6 /Lib/test/test_parser.py
parenta81849b0315277bb3937271174aaaa5059c0b445 (diff)
downloadcpython-c5fc15685202cda73f7c3f5c6f299b0945f58508.zip
cpython-c5fc15685202cda73f7c3f5c6f299b0945f58508.tar.gz
cpython-c5fc15685202cda73f7c3f5c6f299b0945f58508.tar.bz2
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>
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)