mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Merged revisions 62039-62042 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r62039 | georg.brandl | 2008-03-29 06:24:23 -0700 (Sat, 29 Mar 2008) | 3 lines Properly check for consistency with the third argument of compile() when compiling an AST node. ........ r62040 | amaury.forgeotdarc | 2008-03-29 06:47:05 -0700 (Sat, 29 Mar 2008) | 5 lines The buildbot "x86 W2k8 trunk" seems to hang in test_socket. http://www.python.org/dev/buildbot/trunk/x86%20W2k8%20trunk/builds/255/step-test/0 Temporarily increase verbosity of this test. ........ r62042 | amaury.forgeotdarc | 2008-03-29 07:53:05 -0700 (Sat, 29 Mar 2008) | 3 lines Still investigating on the hanging test_socket. the test itself doesn't do anything on windows, focus on setUp and tearDown. ........
This commit is contained in:
parent
9367c78c84
commit
db4115ffc0
6 changed files with 69 additions and 28 deletions
|
@ -427,6 +427,20 @@ if 1:
|
|||
self.assert_(type(ast) == _ast.Module)
|
||||
co2 = compile(ast, '%s3' % fname, 'exec')
|
||||
self.assertEqual(co1, co2)
|
||||
# the code object's filename comes from the second compilation step
|
||||
self.assertEqual(co2.co_filename, '%s3' % fname)
|
||||
|
||||
# raise exception when node type doesn't match with compile mode
|
||||
co1 = compile('print(1)', '<string>', 'exec', _ast.PyCF_ONLY_AST)
|
||||
self.assertRaises(TypeError, compile, co1, '<ast>', 'eval')
|
||||
|
||||
# raise exception when node type is no start node
|
||||
self.assertRaises(TypeError, compile, _ast.If(), '<ast>', 'exec')
|
||||
|
||||
# raise exception when node has invalid children
|
||||
ast = _ast.Module()
|
||||
ast.body = [_ast.BoolOp()]
|
||||
self.assertRaises(TypeError, compile, ast, '<ast>', 'exec')
|
||||
|
||||
|
||||
def test_main():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue