File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -682,6 +682,35 @@ def test_supported_construct_in_supported_version(self):
682682 from typing import Final
683683 """ )
684684
685+ @test_utils .skipBeforePy (
686+ (3 , 12 ),
687+ "This only happens with 3.12 where it puts LOAD_FAST_AND_CLEAR op" ,
688+ )
689+ def test_not_deleted (self ):
690+ # TODO(b/414069834): This shouldn't be an error.
691+ errors = self .CheckWithErrors ("""
692+ import re
693+
694+ class Foo():
695+ A = [re.compile(r) for r in (r'___', )]
696+ B = re.compile(r"dummy") # name-error[e]
697+ """ )
698+ self .assertErrorRegexes (errors , {"e" : r"Name 're' is not defined" })
699+
700+ @test_utils .skipBeforePy (
701+ (3 , 12 ),
702+ "This only happens with 3.12 where it puts LOAD_FAST_AND_CLEAR op" ,
703+ )
704+ def test_not_deleted2 (self ):
705+ # TODO(b/414069834): This shouldn't be an error.
706+ errors = self .CheckWithErrors ("""
707+ class Foo:
708+ x = 1
709+ ys = [y + x for y in [1]] # name-error[e]
710+ z = x + x
711+ """ )
712+ self .assertErrorRegexes (errors , {"e" : r"Name 'x' is not defined" })
713+
685714
686715if __name__ == "__main__" :
687716 test_base .main ()
You can’t perform that action at this time.
0 commit comments