summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2023-05-01 23:55:41 (GMT)
committerGitHub <noreply@github.com>2023-05-01 23:55:41 (GMT)
commitb1ca34d4d5e463b8108eea20090f12292390f0cf (patch)
treeefdfe6e57b0b0b668cde683a0a4966f597fbf54e
parent605f8785db26c3acdde90cfd4ecebb208362a1b8 (diff)
downloadcpython-b1ca34d4d5e463b8108eea20090f12292390f0cf.zip
cpython-b1ca34d4d5e463b8108eea20090f12292390f0cf.tar.gz
cpython-b1ca34d4d5e463b8108eea20090f12292390f0cf.tar.bz2
gh-104016: Skip test for deeply neste f-strings on wasi (#104071)
-rw-r--r--Lib/test/test_fstring.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py
index 5c5176d..be71fde5 100644
--- a/Lib/test/test_fstring.py
+++ b/Lib/test/test_fstring.py
@@ -561,11 +561,12 @@ x = (
])
self.assertRaises(SyntaxError, eval, "f'{" + "("*500 + "}'")
+ @unittest.skipIf(support.is_wasi, "exhausts limited stack on WASI")
def test_fstring_nested_too_deeply(self):
self.assertAllRaise(SyntaxError,
"f-string: expressions nested too deeply",
['f"{1+2:{1+2:{1+1:{1}}}}"'])
-
+
def create_nested_fstring(n):
if n == 0:
return "1+1"
@@ -575,13 +576,13 @@ x = (
self.assertAllRaise(SyntaxError,
"too many nested f-strings",
[create_nested_fstring(160)])
-
+
def test_syntax_error_in_nested_fstring(self):
# See gh-104016 for more information on this crash
self.assertAllRaise(SyntaxError,
"invalid syntax",
['f"{1 1:' + ('{f"1:' * 199)])
-
+
def test_double_braces(self):
self.assertEqual(f'{{', '{')
self.assertEqual(f'a{{', 'a{')