MCPcopy Index your code
hub / github.com/python/cpython / test_max_level

Method test_max_level

Lib/test/test_grammar.py:258–267  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

256 @skip_wasi_stack_overflow()
257 @skip_emscripten_stack_overflow()
258 def test_max_level(self):
259 # Macro defined in Parser/lexer/state.h
260 MAXLEVEL = 200
261
262 result = eval("(" * MAXLEVEL + ")" * MAXLEVEL)
263 self.assertEqual(result, ())
264
265 with self.assertRaises(SyntaxError) as cm:
266 eval("(" * (MAXLEVEL + 1) + ")" * (MAXLEVEL + 1))
267 self.assertStartsWith(str(cm.exception), 'too many nested parentheses')
268
269var_annot_global: int # a global annotated is necessary for test_var_annot
270

Callers

nothing calls this directly

Calls 4

strFunction · 0.85
assertStartsWithMethod · 0.80
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected