1 """Verify that warnings are issued for global statements following use."""
3 from test
.test_support
import run_unittest
, check_syntax_error
8 class GlobalTests(unittest
.TestCase
):
18 check_syntax_error(self
, prog_text_1
)
26 check_syntax_error(self
, prog_text_2
)
35 check_syntax_error(self
, prog_text_3
)
43 compile(prog_text_4
, "<test string>", "exec")
47 with warnings
.catch_warnings():
48 warnings
.filterwarnings("error", module
="<test string>")
49 run_unittest(GlobalTests
)
51 if __name__
== "__main__":