Skip to content
Snippets Groups Projects
Commit 53516228 authored by Bryce Guinta's avatar Bryce Guinta
Browse files

Stop infer_call_result from being improperly called in tests

The calls previously implied that the
result is being called from inside itself
parent c8566357
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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.
Loading
Loading
Loading
Loading
@@ -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)
 
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment