mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-19 03:55:57 +08:00
print isn't in pydoc_topics -> ignore
This commit is contained in:
@@ -80,4 +80,7 @@ def imitate_pydoc(string):
|
|||||||
except TypeError:
|
except TypeError:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
try:
|
||||||
return pydoc_topics.topics[label] if pydoc_topics else ''
|
return pydoc_topics.topics[label] if pydoc_topics else ''
|
||||||
|
except KeyError:
|
||||||
|
return ''
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ import api
|
|||||||
|
|
||||||
|
|
||||||
class Base(unittest.TestCase):
|
class Base(unittest.TestCase):
|
||||||
def get_def(self, src, pos):
|
def get_def(self, src, pos=None):
|
||||||
|
if pos is None:
|
||||||
|
pos = 1, len(src)
|
||||||
script = api.Script(src, pos[0], pos[1], None)
|
script = api.Script(src, pos[0], pos[1], None)
|
||||||
return script.get_definition()
|
return script.get_definition()
|
||||||
|
|
||||||
@@ -254,6 +256,11 @@ class TestRegression(Base):
|
|||||||
types = [o.type for o in objs]
|
types = [o.type for o in objs]
|
||||||
assert 'Import' not in types and 'Class' in types
|
assert 'Import' not in types and 'Class' in types
|
||||||
|
|
||||||
|
def test_keyword_definition_doc(self):
|
||||||
|
""" github jedi-vim issue #44 """
|
||||||
|
defs = self.get_def("print")
|
||||||
|
assert [d.doc for d in defs]
|
||||||
|
|
||||||
|
|
||||||
class TestFeature(Base):
|
class TestFeature(Base):
|
||||||
def test_full_name(self):
|
def test_full_name(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user