diff options
author | Georg Brandl <georg@python.org> | 2006-10-28 13:10:17 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-10-28 13:10:17 (GMT) |
commit | c6fdec6d7eef0582baefd77b4a51da9b69326a37 (patch) | |
tree | 10099b46c733019602f721269f9aea677f6dfc2d /Lib/test/test_support.py | |
parent | 3a3d8ea4970a847d83878102dd382275de2988dc (diff) | |
download | cpython-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.py | 6 |
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 |