MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_var_annot_syntax_errors

Method test_var_annot_syntax_errors

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

Source from the content-addressed store, hash-verified

274
275 @unittest.expectedFailure # TODO: RUSTPYTHON
276 def test_var_annot_syntax_errors(self):
277 # parser pass
278 check_syntax_error(self, "def f: int")
279 check_syntax_error(self, "x: int: str")
280 check_syntax_error(self, "def f():\n"
281 " nonlocal x: int\n")
282 check_syntax_error(self, "def f():\n"
283 " global x: int\n")
284 check_syntax_error(self, "x: int = y = 1")
285 check_syntax_error(self, "z = w: int = 1")
286 check_syntax_error(self, "x: int = y: int = 1")
287 # AST pass
288 check_syntax_error(self, "[x, 0]: int\n")
289 check_syntax_error(self, "f(): int\n")
290 check_syntax_error(self, "(x,): int")
291 check_syntax_error(self, "def f():\n"
292 " (x, y): int = (1, 2)\n")
293 # symtable pass
294 check_syntax_error(self, "def f():\n"
295 " x: int\n"
296 " global x\n")
297 check_syntax_error(self, "def f():\n"
298 " global x\n"
299 " x: int\n")
300 check_syntax_error(self, "def f():\n"
301 " x: int\n"
302 " nonlocal x\n")
303 check_syntax_error(self, "def f():\n"
304 " nonlocal x\n"
305 " x: int\n")
306
307 @unittest.expectedFailure # TODO: RUSTPYTHON
308 def test_var_annot_basic_semantics(self):

Callers

nothing calls this directly

Calls 1

check_syntax_errorFunction · 0.90

Tested by

no test coverage detected