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 @@ -350,6 +350,11 @@ def test_var_annot_syntax_errors(self):
350
350
check_syntax_error (self , "x: int: str" )
351
351
check_syntax_error (self , "def f():\n "
352
352
" nonlocal x: int\n " )
353
+ check_syntax_error (self , "def f():\n "
354
+ " global x: int\n " )
355
+ check_syntax_error (self , "x: int = y = 1" )
356
+ check_syntax_error (self , "z = w: int = 1" )
357
+ check_syntax_error (self , "x: int = y: int = 1" )
353
358
# AST pass
354
359
check_syntax_error (self , "[x, 0]: int\n " )
355
360
check_syntax_error (self , "f(): int\n " )
@@ -363,6 +368,12 @@ def test_var_annot_syntax_errors(self):
363
368
check_syntax_error (self , "def f():\n "
364
369
" global x\n "
365
370
" x: int\n " )
371
+ check_syntax_error (self , "def f():\n "
372
+ " x: int\n "
373
+ " nonlocal x\n " )
374
+ check_syntax_error (self , "def f():\n "
375
+ " nonlocal x\n "
376
+ " x: int\n " )
366
377
367
378
def test_var_annot_basic_semantics (self ):
368
379
# execution order
You can’t perform that action at this time.
0 commit comments