forked from VimPlug/jedi
Add a failing test for type inference from docstring
This commit is contained in:
@@ -297,6 +297,27 @@ class TestRegression(TestBase):
|
|||||||
assert c[0].word == 'IndentationError'
|
assert c[0].word == 'IndentationError'
|
||||||
self.assertEqual(c[0].complete, 'or')
|
self.assertEqual(c[0].complete, 'or')
|
||||||
|
|
||||||
|
def test_docstrings_type_str(self):
|
||||||
|
s = """
|
||||||
|
def func(arg):
|
||||||
|
'''
|
||||||
|
:type arg: str
|
||||||
|
'''
|
||||||
|
arg."""
|
||||||
|
|
||||||
|
words = [c.word for c in self.complete(s)]
|
||||||
|
assert 'join' in words
|
||||||
|
|
||||||
|
def test_docstrings_type_dotted_import(self):
|
||||||
|
s = """
|
||||||
|
def func(arg):
|
||||||
|
'''
|
||||||
|
:type arg: threading.Thread
|
||||||
|
'''
|
||||||
|
arg."""
|
||||||
|
words = [c.word for c in self.complete(s)]
|
||||||
|
assert 'start' in words
|
||||||
|
|
||||||
|
|
||||||
class TestFeature(TestBase):
|
class TestFeature(TestBase):
|
||||||
def test_full_name(self):
|
def test_full_name(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user