mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Add test for syntax error on "x = 1 + 1".
Move check_syntax() function into test_support.
This commit is contained in:
parent
c348cd7518
commit
4779399e9f
4 changed files with 13 additions and 22 deletions
|
@ -1,4 +1,4 @@
|
|||
from test.test_support import verify, TestFailed
|
||||
from test.test_support import verify, TestFailed, check_syntax
|
||||
|
||||
print "1. simple nesting"
|
||||
|
||||
|
@ -177,14 +177,6 @@ verify(f(6) == 720)
|
|||
|
||||
print "11. unoptimized namespaces"
|
||||
|
||||
def check_syntax(s):
|
||||
try:
|
||||
compile(s, '?', 'exec')
|
||||
except SyntaxError:
|
||||
pass
|
||||
else:
|
||||
raise TestFailed
|
||||
|
||||
check_syntax("""def unoptimized_clash1(strip):
|
||||
def f(s):
|
||||
from string import *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue