@@ -1924,7 +1924,7 @@ def test_keyword_trials_do_not_repeat_warnings(self):
19241924 def test_keyword_replay_requires_complete_valid_input (self ):
19251925 for source in ("dell 1" , "impor math\n other =" , "whille True:\n pass" ,
19261926 "switch +:\n case:" , "function f(=):\n pass" , "(mat x)" ,
1927- "impor math\n " + "pass\n " * 3000 ):
1927+ "impor math\n " + "pass\n " * 20000 ):
19281928 with self .subTest (source = source ):
19291929 with self .assertRaises (SyntaxError ) as caught :
19301930 compile (source , "<test>" , "exec" )
@@ -1951,13 +1951,13 @@ def test_keyword_trials_do_not_call_normalizer(self):
19511951 @cpython_only
19521952 def test_keyword_replay_source_limit (self ):
19531953 with tempfile .TemporaryDirectory () as script_dir :
1954- for size in (64 * 1024 - 512 , 64 * 1024 + 512 ):
1954+ for size in (256 * 1024 - 512 , 256 * 1024 + 512 ):
19551955 literal = "value = " + repr ("a" * size ) + "\n "
19561956 for source in (literal + "impor math" , "impor math\n " + literal ):
19571957 with self .subTest (size = size , typo_first = source .startswith ("impor" )):
19581958 with self .assertRaises (SyntaxError ) as caught :
19591959 compile (source , "<test>" , "exec" )
1960- expected = size < 64 * 1024
1960+ expected = size < 256 * 1024
19611961 self .assertEqual (caught .exception ._metadata is not None , expected )
19621962 script = make_script (script_dir , "large_keyword_typo" , source )
19631963 _ , _ , stderr = assert_python_failure (script )
@@ -1968,8 +1968,8 @@ def test_keyword_replay_source_limit(self):
19681968 @cpython_only
19691969 def test_keyword_replay_work_limit (self ):
19701970 # Several candidates must share the budget, including failed passes.
1971- for count , expected in ((100 , "in " ), (300 , None )):
1972- source = "x = 1\n " * count + "for x im seq: \n pass "
1971+ for count , expected in ((100 , "lambda " ), (2000 , None )):
1972+ source = "x = 1\n " * count + "f(" + "fron, " * 8 + "lamda x: x) "
19731973 with self .subTest (count = count ), self .assertRaises (SyntaxError ) as caught :
19741974 compile (source , "<test>" , "exec" )
19751975 metadata = caught .exception ._metadata
0 commit comments