diff options
Diffstat (limited to 'astroid')
-rw-r--r-- | astroid/nodes/node_classes.py | 46 |
1 files changed, 5 insertions, 41 deletions
diff --git a/astroid/nodes/node_classes.py b/astroid/nodes/node_classes.py index aeed360c..8092abcf 100644 --- a/astroid/nodes/node_classes.py +++ b/astroid/nodes/node_classes.py @@ -1013,49 +1013,13 @@ class Assert(_base_nodes.Statement): _astroid_fields = ("test", "fail") - def __init__( - self, - lineno: int | None = None, - col_offset: int | None = None, - parent: NodeNG | None = None, - *, - end_lineno: int | None = None, - end_col_offset: int | None = None, - ) -> None: - """ - :param lineno: The line that this node appears on in the source code. - - :param col_offset: The column that this node appears on in the - source code. - - :param parent: The parent node in the syntax tree. - - :param end_lineno: The last line this node appears on in the source code. - - :param end_col_offset: The end column this node appears on in the - source code. Note: This is after the last symbol. - """ - self.test: NodeNG | None = None - """The test that passes or fails the assertion.""" - - self.fail: NodeNG | None = None # can be None - """The message shown when the assertion fails.""" - - super().__init__( - lineno=lineno, - col_offset=col_offset, - end_lineno=end_lineno, - end_col_offset=end_col_offset, - parent=parent, - ) - - def postinit(self, test: NodeNG | None = None, fail: NodeNG | None = None) -> None: - """Do some setup after initialisation. + test: NodeNG + """The test that passes or fails the assertion.""" - :param test: The test that passes or fails the assertion. + fail: NodeNG | None + """The message shown when the assertion fails.""" - :param fail: The message shown when the assertion fails. - """ + def postinit(self, test: NodeNG, fail: NodeNG | None) -> None: self.fail = fail self.test = test |