mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
add a separate docstring testing file, #181
This commit is contained in:
@@ -347,41 +347,6 @@ class TestRegression(TestBase):
|
||||
assert self.completions(s)
|
||||
|
||||
|
||||
|
||||
class TestDocstring(TestBase):
|
||||
def test_function_doc(self):
|
||||
defs = self.goto_definitions("""
|
||||
def func():
|
||||
'''Docstring of `func`.'''
|
||||
func""")
|
||||
self.assertEqual(defs[0].raw_doc, 'Docstring of `func`.')
|
||||
|
||||
@unittest.skip('need evaluator class for that')
|
||||
def test_attribute_docstring(self):
|
||||
defs = self.goto_definitions("""
|
||||
x = None
|
||||
'''Docstring of `x`.'''
|
||||
x""")
|
||||
self.assertEqual(defs[0].raw_doc, 'Docstring of `x`.')
|
||||
|
||||
@unittest.skip('need evaluator class for that')
|
||||
def test_multiple_docstrings(self):
|
||||
defs = self.goto_definitions("""
|
||||
def func():
|
||||
'''Original docstring.'''
|
||||
x = func
|
||||
'''Docstring of `x`.'''
|
||||
x""")
|
||||
docs = [d.raw_doc for d in defs]
|
||||
self.assertEqual(docs, ['Original docstring.', 'Docstring of `x`.'])
|
||||
|
||||
def test_completion(self):
|
||||
assert self.completions('''
|
||||
class DocstringCompletion():
|
||||
#? []
|
||||
""" asdfas """''')
|
||||
|
||||
|
||||
class TestFeature(TestBase):
|
||||
def test_preload_modules(self):
|
||||
def check_loaded(*modules):
|
||||
|
||||
Reference in New Issue
Block a user