From bf7d42e494d8c4ad3526bd7983067a05e9a8a248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sat, 22 Apr 2023 22:23:00 +0200 Subject: Fix constructors of ``Module`` (#2133) --- tests/test_nodes_lineno.py | 2 +- tests/test_scoped_nodes.py | 23 ----------------------- 2 files changed, 1 insertion(+), 24 deletions(-) (limited to 'tests') diff --git a/tests/test_nodes_lineno.py b/tests/test_nodes_lineno.py index 962fe483..bbc1a300 100644 --- a/tests/test_nodes_lineno.py +++ b/tests/test_nodes_lineno.py @@ -1241,6 +1241,6 @@ class TestLinenoColOffset: module = astroid.parse(code) assert isinstance(module, nodes.Module) assert module.lineno == 0 - assert module.col_offset is None + assert module.col_offset == 0 assert module.end_lineno is None assert module.end_col_offset is None diff --git a/tests/test_scoped_nodes.py b/tests/test_scoped_nodes.py index 3e8256dd..0cfe411c 100644 --- a/tests/test_scoped_nodes.py +++ b/tests/test_scoped_nodes.py @@ -2947,26 +2947,3 @@ def test_deprecation_of_doc_attribute() -> None: with pytest.warns(DeprecationWarning) as records: assert node_func.doc == "Docstring" assert len(records) == 1 - - # If 'doc' is passed to Module, ClassDef, FunctionDef, - # a DeprecationWarning should be raised - doc_node = nodes.Const("Docstring") - with pytest.warns(DeprecationWarning) as records: - node_module = nodes.Module(name="MyModule", doc="Docstring") - node_class = nodes.ClassDef( - name="MyClass", - lineno=0, - col_offset=0, - end_lineno=0, - end_col_offset=0, - parent=nodes.Unknown(), - ) - node_func = nodes.FunctionDef( - name="MyFunction", - lineno=0, - col_offset=0, - parent=node_module, - end_lineno=0, - end_col_offset=0, - ) - assert len(records) == 1 -- cgit v1.2.1