summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ast.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-08-13 08:51:18 (GMT)
committerGeorg Brandl <georg@python.org>2009-08-13 08:51:18 (GMT)
commitab91fdef1f1e556203a2eee98ba7d379e4790de9 (patch)
tree6f8f00dc18cc5f2801a675df277c2c595eb85ec8 /Lib/test/test_ast.py
parentef82be368abdea8e8032500e7ecc3a22f5f07851 (diff)
downloadcpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.zip
cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.gz
cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.bz2
Merged revisions 73715 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r--Lib/test/test_ast.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 54a3b35..c22d0d4 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -116,20 +116,20 @@ eval_tests = [
class AST_Tests(unittest.TestCase):
- def _assert_order(self, ast_node, parent_pos):
+ def _assertTrueorder(self, ast_node, parent_pos):
if not isinstance(ast_node, ast.AST) or ast_node._fields is None:
return
if isinstance(ast_node, (ast.expr, ast.stmt, ast.excepthandler)):
node_pos = (ast_node.lineno, ast_node.col_offset)
- self.assert_(node_pos >= parent_pos)
+ self.assertTrue(node_pos >= parent_pos)
parent_pos = (ast_node.lineno, ast_node.col_offset)
for name in ast_node._fields:
value = getattr(ast_node, name)
if isinstance(value, list):
for child in value:
- self._assert_order(child, parent_pos)
+ self._assertTrueorder(child, parent_pos)
elif value is not None:
- self._assert_order(value, parent_pos)
+ self._assertTrueorder(value, parent_pos)
def test_snippets(self):
for input, output, kind in ((exec_tests, exec_results, "exec"),
@@ -138,7 +138,7 @@ class AST_Tests(unittest.TestCase):
for i, o in zip(input, output):
ast_tree = compile(i, "?", kind, ast.PyCF_ONLY_AST)
self.assertEquals(to_tuple(ast_tree), o)
- self._assert_order(ast_tree, (0, 0))
+ self._assertTrueorder(ast_tree, (0, 0))
def test_nodeclasses(self):
x = ast.BinOp(1, 2, 3, lineno=0)