summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_support.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r--Lib/test/test_support.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index 8861399..3a20b2e 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -79,3 +79,12 @@ def verify(condition, reason='test failed'):
if not condition:
raise TestFailed(reason)
+
+def check_syntax(statement):
+ try:
+ compile(statement, '<string>', 'exec')
+ except SyntaxError:
+ pass
+ else:
+ print 'Missing SyntaxError: "%s"' % statement
+