diff options
author | Bryce Guinta <bryce.paul.guinta@gmail.com> | 2018-02-17 15:42:10 -0700 |
---|---|---|
committer | Bryce Guinta <bryce.paul.guinta@gmail.com> | 2018-02-17 16:47:29 -0700 |
commit | 53516228e51826440a28503cc461cfc2c6988f9b (patch) | |
tree | bf7749a013255540e67a2c3b1e13139012491146 | |
parent | c8566357b4f592e94ec57fbd6547cae1c30c44a1 (diff) | |
download | astroid-git-53516228e51826440a28503cc461cfc2c6988f9b.tar.gz |
Stop infer_call_result from being improperly called in tests
The calls previously implied that the
result is being called from inside itself
-rw-r--r-- | astroid/scoped_nodes.py | 2 | ||||
-rw-r--r-- | astroid/tests/unittest_scoped_nodes.py | 2 | ||||
-rw-r--r-- | astroid/tests/unittest_transforms.py | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/astroid/scoped_nodes.py b/astroid/scoped_nodes.py index 144cd83b..dba9a8e7 100644 --- a/astroid/scoped_nodes.py +++ b/astroid/scoped_nodes.py @@ -1526,7 +1526,7 @@ class FunctionDef(node_classes.Statement, Lambda): return next(self.nodes_of_class(yield_nodes, skip_klass=(FunctionDef, Lambda)), False) - def infer_call_result(self, caller, context=None): + def infer_call_result(self, caller=None, context=None): """Infer what the function returns when called. :returns: What the function returns. diff --git a/astroid/tests/unittest_scoped_nodes.py b/astroid/tests/unittest_scoped_nodes.py index dcbc1274..b8682461 100644 --- a/astroid/tests/unittest_scoped_nodes.py +++ b/astroid/tests/unittest_scoped_nodes.py @@ -1517,7 +1517,7 @@ class ClassNodeTest(ModuleLoader, unittest.TestCase): def test(): #@ yield """) - result = next(func.infer_call_result(func)) + result = next(func.infer_call_result()) self.assertIsInstance(result, Generator) self.assertEqual(result.parent, func) diff --git a/astroid/tests/unittest_transforms.py b/astroid/tests/unittest_transforms.py index b6b7c9d8..cca47130 100644 --- a/astroid/tests/unittest_transforms.py +++ b/astroid/tests/unittest_transforms.py @@ -146,7 +146,7 @@ class TestTransforms(unittest.TestCase): for decorator in node.decorators.nodes: inferred = next(decorator.infer()) if inferred.qname() == 'abc.abstractmethod': - return next(node.infer_call_result(node)) + return next(node.infer_call_result()) return None manager = builder.MANAGER |