(self, ast_node, parent_pos)
| 65 | return name != 'AST' and name[0].isupper() |
| 66 | |
| 67 | def _assertTrueorder(self, ast_node, parent_pos): |
| 68 | if not isinstance(ast_node, ast.AST) or ast_node._fields is None: |
| 69 | return |
| 70 | if isinstance(ast_node, (ast.expr, ast.stmt, ast.excepthandler)): |
| 71 | node_pos = (ast_node.lineno, ast_node.col_offset) |
| 72 | self.assertGreaterEqual(node_pos, parent_pos) |
| 73 | parent_pos = (ast_node.lineno, ast_node.col_offset) |
| 74 | for name in ast_node._fields: |
| 75 | value = getattr(ast_node, name) |
| 76 | if isinstance(value, list): |
| 77 | first_pos = parent_pos |
| 78 | if value and name == 'decorator_list': |
| 79 | first_pos = (value[0].lineno, value[0].col_offset) |
| 80 | for child in value: |
| 81 | self._assertTrueorder(child, first_pos) |
| 82 | elif value is not None: |
| 83 | self._assertTrueorder(value, parent_pos) |
| 84 | self.assertEqual(ast_node._fields, ast_node.__match_args__) |
| 85 | |
| 86 | def test_AST_objects(self): |
| 87 | x = ast.AST() |
no test coverage detected