diff options
Diffstat (limited to 'tests/pyreverse/test_utils.py')
-rw-r--r-- | tests/pyreverse/test_utils.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/pyreverse/test_utils.py b/tests/pyreverse/test_utils.py index 1d231eafa..5abd0126c 100644 --- a/tests/pyreverse/test_utils.py +++ b/tests/pyreverse/test_utils.py @@ -9,6 +9,7 @@ """Tests for pylint.pyreverse.utils""" +from typing import Any from unittest.mock import patch import astroid @@ -80,8 +81,8 @@ def test_get_annotation_assignattr(init_method, label): @patch("pylint.pyreverse.utils.get_annotation") -@patch("astroid.nodes.NodeNG.infer", side_effect=astroid.InferenceError) -def test_infer_node_1(mock_infer, mock_get_annotation): +@patch("astroid.node_classes.NodeNG.infer", side_effect=astroid.InferenceError) +def test_infer_node_1(mock_infer: Any, mock_get_annotation: Any) -> None: """Return set() when astroid.InferenceError is raised and an annotation has not been returned """ @@ -93,8 +94,8 @@ def test_infer_node_1(mock_infer, mock_get_annotation): @patch("pylint.pyreverse.utils.get_annotation") -@patch("astroid.nodes.NodeNG.infer") -def test_infer_node_2(mock_infer, mock_get_annotation): +@patch("astroid.node_classes.NodeNG.infer") +def test_infer_node_2(mock_infer: Any, mock_get_annotation: Any) -> None: """Return set(node.infer()) when InferenceError is not raised and an annotation has not been returned """ @@ -105,7 +106,7 @@ def test_infer_node_2(mock_infer, mock_get_annotation): assert mock_infer.called -def test_infer_node_3(): +def test_infer_node_3() -> None: """Return a set containing a nodes.ClassDef object when the attribute has a type annotation""" node = astroid.extract_node( @@ -123,7 +124,7 @@ def test_infer_node_3(): assert isinstance(infer_node(instance_attr).pop(), nodes.ClassDef) -def test_infer_node_4(): +def test_infer_node_4() -> None: """Verify the label for an argument with a typehint of the type nodes.Subscript """ |