summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2023-04-25 08:34:23 +0200
committerGitHub <noreply@github.com>2023-04-25 08:34:23 +0200
commitfc684733795186ab964095bc40646fc37f586cfd (patch)
tree549c9382dbbcbda9412bc4b328075a42afb8b274 /tests
parent617b6a7f6fb80395ae527dd6304b4cb45623604c (diff)
downloadastroid-git-fc684733795186ab964095bc40646fc37f586cfd.tar.gz
Make all arguments to ``nodes.NodeNG.__init__`` required (#2138)
Diffstat (limited to 'tests')
-rw-r--r--tests/test_object_model.py24
-rw-r--r--tests/test_transforms.py8
2 files changed, 29 insertions, 3 deletions
diff --git a/tests/test_object_model.py b/tests/test_object_model.py
index 81c6ba5c..3acb17af 100644
--- a/tests/test_object_model.py
+++ b/tests/test_object_model.py
@@ -307,7 +307,17 @@ class ModuleModelTest(unittest.TestCase):
init_ = next(ast_nodes[9].infer())
assert isinstance(init_, bases.BoundMethod)
- init_result = next(init_.infer_call_result(nodes.Call()))
+ init_result = next(
+ init_.infer_call_result(
+ nodes.Call(
+ parent=None,
+ lineno=None,
+ col_offset=None,
+ end_lineno=None,
+ end_col_offset=None,
+ )
+ )
+ )
assert isinstance(init_result, nodes.Const)
assert init_result.value is None
@@ -485,7 +495,17 @@ class FunctionModelTest(unittest.TestCase):
init_ = next(ast_nodes[9].infer())
assert isinstance(init_, bases.BoundMethod)
- init_result = next(init_.infer_call_result(nodes.Call()))
+ init_result = next(
+ init_.infer_call_result(
+ nodes.Call(
+ parent=None,
+ lineno=None,
+ col_offset=None,
+ end_lineno=None,
+ end_col_offset=None,
+ )
+ )
+ )
assert isinstance(init_result, nodes.Const)
assert init_result.value is None
diff --git a/tests/test_transforms.py b/tests/test_transforms.py
index 8eb4cdea..fd9aeb62 100644
--- a/tests/test_transforms.py
+++ b/tests/test_transforms.py
@@ -87,7 +87,13 @@ class TestTransforms(unittest.TestCase):
def test_transform_patches_locals(self) -> None:
def transform_function(node: FunctionDef) -> None:
- assign = nodes.Assign()
+ assign = nodes.Assign(
+ parent=node,
+ lineno=node.lineno,
+ col_offset=node.col_offset,
+ end_lineno=node.end_lineno,
+ end_col_offset=node.end_col_offset,
+ )
name = nodes.AssignName(
name="value",
lineno=0,