diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-06-30 23:06:06 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-06-30 23:06:06 (GMT) |
commit | c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9 (patch) | |
tree | 6350dab0b481e6de307dc4e043c6230f463a9ca7 /Lib/test/test_ast.py | |
parent | 98d23f2e065713ccfbc07d9a0b65f737a212bfb5 (diff) | |
download | cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.zip cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.tar.gz cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.tar.bz2 |
convert old fail* assertions to assert*
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r-- | Lib/test/test_ast.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index 021ae95..63e9763 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_slice(self): slc = ast.parse("x[::]").body[0].value.slice |