summaryrefslogtreecommitdiff
path: root/tests/pyreverse
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2022-09-09 09:52:43 +0200
committerGitHub <noreply@github.com>2022-09-09 09:52:43 +0200
commitf29bdd4e04c8c144b378220434646b37a8e7d9a0 (patch)
tree23231076dbd0beb358de9ea5d4325a27f8af40f1 /tests/pyreverse
parentef7a9108e1bc5d1052d41bf7eda0311610c39d73 (diff)
downloadpylint-git-f29bdd4e04c8c144b378220434646b37a8e7d9a0.tar.gz
Turn on ``check-untyped-defs`` in ``mypy`` (#7407)
Diffstat (limited to 'tests/pyreverse')
-rw-r--r--tests/pyreverse/test_utils.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/pyreverse/test_utils.py b/tests/pyreverse/test_utils.py
index 70d95346f..adf7579b1 100644
--- a/tests/pyreverse/test_utils.py
+++ b/tests/pyreverse/test_utils.py
@@ -48,8 +48,10 @@ def test_get_visibility(names, expected):
)
def test_get_annotation_annassign(assign, label):
"""AnnAssign."""
- node = astroid.extract_node(assign)
- got = get_annotation(node.value).name
+ node: nodes.AnnAssign = astroid.extract_node(assign)
+ annotation = get_annotation(node.value)
+ assert annotation is not None
+ got = annotation.name
assert isinstance(node, nodes.AnnAssign)
assert got == label, f"got {got} instead of {label} for value {node}"
@@ -75,7 +77,9 @@ def test_get_annotation_assignattr(init_method, label):
instance_attrs = node.instance_attrs
for assign_attrs in instance_attrs.values():
for assign_attr in assign_attrs:
- got = get_annotation(assign_attr).name
+ annotation = get_annotation(assign_attr)
+ assert annotation is not None
+ got = annotation.name
assert isinstance(assign_attr, nodes.AssignAttr)
assert got == label, f"got {got} instead of {label} for value {node}"