mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Merged revisions 86596 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
This commit is contained in:
parent
40a92f5c65
commit
2623a37852
184 changed files with 2328 additions and 2326 deletions
|
@ -147,7 +147,7 @@ class AST_Tests(unittest.TestCase):
|
|||
(eval_tests, eval_results, "eval")):
|
||||
for i, o in itertools.izip(input, output):
|
||||
ast_tree = compile(i, "?", kind, ast.PyCF_ONLY_AST)
|
||||
self.assertEquals(to_tuple(ast_tree), o)
|
||||
self.assertEqual(to_tuple(ast_tree), o)
|
||||
self._assertTrueorder(ast_tree, (0, 0))
|
||||
|
||||
def test_slice(self):
|
||||
|
@ -171,20 +171,20 @@ class AST_Tests(unittest.TestCase):
|
|||
|
||||
def test_nodeclasses(self):
|
||||
x = ast.BinOp(1, 2, 3, lineno=0)
|
||||
self.assertEquals(x.left, 1)
|
||||
self.assertEquals(x.op, 2)
|
||||
self.assertEquals(x.right, 3)
|
||||
self.assertEquals(x.lineno, 0)
|
||||
self.assertEqual(x.left, 1)
|
||||
self.assertEqual(x.op, 2)
|
||||
self.assertEqual(x.right, 3)
|
||||
self.assertEqual(x.lineno, 0)
|
||||
|
||||
# node raises exception when not given enough arguments
|
||||
self.assertRaises(TypeError, ast.BinOp, 1, 2)
|
||||
|
||||
# can set attributes through kwargs too
|
||||
x = ast.BinOp(left=1, op=2, right=3, lineno=0)
|
||||
self.assertEquals(x.left, 1)
|
||||
self.assertEquals(x.op, 2)
|
||||
self.assertEquals(x.right, 3)
|
||||
self.assertEquals(x.lineno, 0)
|
||||
self.assertEqual(x.left, 1)
|
||||
self.assertEqual(x.op, 2)
|
||||
self.assertEqual(x.right, 3)
|
||||
self.assertEqual(x.lineno, 0)
|
||||
|
||||
# this used to fail because Sub._fields was None
|
||||
x = ast.Sub()
|
||||
|
@ -202,7 +202,7 @@ class AST_Tests(unittest.TestCase):
|
|||
for protocol in protocols:
|
||||
for ast in (compile(i, "?", "exec", 0x400) for i in exec_tests):
|
||||
ast2 = mod.loads(mod.dumps(ast, protocol))
|
||||
self.assertEquals(to_tuple(ast2), to_tuple(ast))
|
||||
self.assertEqual(to_tuple(ast2), to_tuple(ast))
|
||||
|
||||
|
||||
class ASTHelpers_Test(unittest.TestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue