mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-10 07:41:51 +08:00
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):
|
def __getattr__(self, name):
|
||||||
if name not in ['start_pos', 'end_pos', 'name', 'get_imports',
|
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)!"
|
raise AttributeError("Instance %s: Don't touch this (%s)!"
|
||||||
% (self, name))
|
% (self, name))
|
||||||
return getattr(self.base, name)
|
return getattr(self.base, name)
|
||||||
|
|||||||
@@ -90,6 +90,15 @@ class TestRegression(TestBase):
|
|||||||
if not is_py25:
|
if not is_py25:
|
||||||
assert len(r[0].doc) > 100
|
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
|
||||||
|
doc = defs[0].doc # removing this line won't work
|
||||||
|
assert "f(x, y = 1, z = 'a')" in doc
|
||||||
|
|
||||||
def test_definition_at_zero(self):
|
def test_definition_at_zero(self):
|
||||||
assert self.definition("a", (1, 1)) == []
|
assert self.definition("a", (1, 1)) == []
|
||||||
s = self.definition("str", (1, 1))
|
s = self.definition("str", (1, 1))
|
||||||
|
|||||||
Reference in New Issue
Block a user