1
0
forked from VimPlug/jedi

Call signatures again: function definitions and other things that cannot be a part of call signatures stop the process of scanning for them. Also strings get replaced and simplified.

This commit is contained in:
Dave Halter
2015-02-25 13:33:09 +01:00
parent 48392a7dac
commit 8c08a4e574
2 changed files with 40 additions and 6 deletions

View File

@@ -177,12 +177,21 @@ class TestCallSignatures(TestCase):
def test_whitespace_before_bracket(self):
self._run('str (', 'str', 0)
self._run('str (";', 'str', 0)
# TODO this is not actually valid Python, the newline token should be
# ignored.
self._run('str\n(', 'str', 0)
def test_brackets_in_string_literals(self):
self._run('str (" (', 'str', 0)
self._run('str (" )', 'str', 0)
def test_function_definitions_should_break(self):
"""
Function definitions (and other tokens that cannot exist within call
signatures) should break and not be able to return a call signature.
"""
assert not Script('str(\ndef x').call_signatures()
class TestParams(TestCase):
def params(self, source, line=None, column=None):