File tree 1 file changed +11
-0
lines changed 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -355,6 +355,11 @@ def test_var_annot_syntax_errors(self):
355
355
check_syntax_error (self , "x: int: str" )
356
356
check_syntax_error (self , "def f():\n "
357
357
" nonlocal x: int\n " )
358
+ check_syntax_error (self , "def f():\n "
359
+ " global x: int\n " )
360
+ check_syntax_error (self , "x: int = y = 1" )
361
+ check_syntax_error (self , "z = w: int = 1" )
362
+ check_syntax_error (self , "x: int = y: int = 1" )
358
363
# AST pass
359
364
check_syntax_error (self , "[x, 0]: int\n " )
360
365
check_syntax_error (self , "f(): int\n " )
@@ -368,6 +373,12 @@ def test_var_annot_syntax_errors(self):
368
373
check_syntax_error (self , "def f():\n "
369
374
" global x\n "
370
375
" x: int\n " )
376
+ check_syntax_error (self , "def f():\n "
377
+ " x: int\n "
378
+ " nonlocal x\n " )
379
+ check_syntax_error (self , "def f():\n "
380
+ " nonlocal x\n "
381
+ " x: int\n " )
371
382
372
383
def test_var_annot_basic_semantics (self ):
373
384
# execution order
You can’t perform that action at this time.
0 commit comments