Kaydet (Commit) 2bf74fd0 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

this is better written using assertRaises

üst 03715486
......@@ -370,12 +370,8 @@ def make_bad_fd():
unlink(TESTFN)
def check_syntax_error(testcase, statement):
try:
compile(statement, '<test string>', 'exec')
except SyntaxError:
pass
else:
testcase.fail('Missing SyntaxError: "%s"' % statement)
testcase.assertRaises(SyntaxError, compile, statement,
'<test string>', 'exec')
def open_urlresource(url):
import urllib, urlparse
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment