summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_support.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-10-28 13:10:17 (GMT)
committerGeorg Brandl <georg@python.org>2006-10-28 13:10:17 (GMT)
commitc6fdec6d7eef0582baefd77b4a51da9b69326a37 (patch)
tree10099b46c733019602f721269f9aea677f6dfc2d /Lib/test/test_support.py
parent3a3d8ea4970a847d83878102dd382275de2988dc (diff)
downloadcpython-c6fdec6d7eef0582baefd77b4a51da9b69326a37.zip
cpython-c6fdec6d7eef0582baefd77b4a51da9b69326a37.tar.gz
cpython-c6fdec6d7eef0582baefd77b4a51da9b69326a37.tar.bz2
Convert test_global, test_scope and test_grammar to unittest.
I tried to enclose all tests which must be run at the toplevel (instead of inside a method) in exec statements.
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r--Lib/test/test_support.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index a9d5dab..ae39aa1 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -245,13 +245,13 @@ def sortdict(dict):
withcommas = ", ".join(reprpairs)
return "{%s}" % withcommas
-def check_syntax(statement):
+def check_syntax_error(testcase, statement):
try:
- compile(statement, '<string>', 'exec')
+ compile(statement, '<test string>', 'exec')
except SyntaxError:
pass
else:
- print 'Missing SyntaxError: "%s"' % statement
+ testcase.fail('Missing SyntaxError: "%s"' % statement)
def open_urlresource(url):
import urllib, urlparse