forked from VimPlug/jedi
Merge pull request #143 from tkf/call-signature-test
Add a test for docstring in call signature
This commit is contained in:
@@ -169,7 +169,7 @@ class Instance(use_metaclass(cache.CachedMetaClass, Executable)):
|
||||
|
||||
def __getattr__(self, name):
|
||||
if name not in ['start_pos', 'end_pos', 'name', 'get_imports',
|
||||
'docstr', 'asserts']:
|
||||
'doc', 'docstr', 'asserts']:
|
||||
raise AttributeError("Instance %s: Don't touch this (%s)!"
|
||||
% (self, name))
|
||||
return getattr(self.base, name)
|
||||
|
||||
@@ -715,7 +715,7 @@ class Statement(Simple):
|
||||
return ''.join(pieces)
|
||||
return '%s %s ' % (''.join(pieces), assignment)
|
||||
|
||||
code = ''.join(assemble(*a) for a in self._assignment_details)
|
||||
code = ''.join(assemble(*a) for a in self.assignment_details)
|
||||
code += assemble(self.get_commands())
|
||||
|
||||
if new_line:
|
||||
|
||||
@@ -90,6 +90,14 @@ class TestRegression(TestBase):
|
||||
if not is_py25:
|
||||
assert len(r[0].doc) > 100
|
||||
|
||||
def test_function_call_signature(self):
|
||||
defs = self.definition("""
|
||||
def f(x, y=1, z='a'):
|
||||
pass
|
||||
f""")
|
||||
doc = defs[0].doc
|
||||
assert "f(x, y = 1, z = 'a')" in doc
|
||||
|
||||
def test_definition_at_zero(self):
|
||||
assert self.definition("a", (1, 1)) == []
|
||||
s = self.definition("str", (1, 1))
|
||||
|
||||
Reference in New Issue
Block a user