mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-05 22:57:41 +08:00
Undo finding signatures for everything and only do it for stubs and non-statements for when used in docstrings
This commit is contained in:
@@ -59,7 +59,7 @@ def test_help_no_returns(Script, code, kwargs):
|
||||
('X.x', 'Yeah '),
|
||||
('X().x', 'Yeah '),
|
||||
('X.y', 'f g '),
|
||||
('X.z', '<lambda>(x)'),
|
||||
('X.z', ''),
|
||||
]
|
||||
)
|
||||
def test_attribute_docstrings(goto_or_help, expected_doc, to_execute):
|
||||
|
||||
@@ -76,7 +76,7 @@ def test_multiple_docstrings(Script):
|
||||
x = func
|
||||
'''Docstring of `x`.'''
|
||||
x""").help()
|
||||
assert d.docstring() == 'func()\n\nDocstring of `x`.'
|
||||
assert d.docstring() == 'Docstring of `x`.'
|
||||
|
||||
|
||||
def test_completion(Script):
|
||||
|
||||
@@ -27,8 +27,7 @@ def test_find_stubs_infer(ScriptInStubFolder, code, expected):
|
||||
assert [d.name for d in defs] == expected
|
||||
|
||||
|
||||
func_without_stub_sig = 'func_without_stub(a)'
|
||||
func_without_stub_doc = func_without_stub_sig + '\n\nnostubdoc'
|
||||
func_without_stub_doc = 'func_without_stub(a)\n\nnostubdoc'
|
||||
func_with_stub_doc = 'func_with_stub(b: int) -> float\n\nwithstubdoc'
|
||||
|
||||
|
||||
@@ -38,16 +37,16 @@ func_with_stub_doc = 'func_with_stub(b: int) -> float\n\nwithstubdoc'
|
||||
('from with_python import python_only', ''),
|
||||
('from with_python import both', ''),
|
||||
|
||||
('import with_python; with_python.func_without_stub', func_without_stub_sig),
|
||||
('import with_python; with_python.func_without_stub', ''),
|
||||
('import with_python.module; with_python.module.func_without_stub', func_without_stub_doc),
|
||||
('from with_python import module; module.func_without_stub', func_without_stub_doc),
|
||||
('from with_python.module import func_without_stub', func_without_stub_doc),
|
||||
('from with_python.module import func_without_stub as f; f', func_without_stub_doc),
|
||||
('from with_python.module import func_without_stub; func_without_stub',
|
||||
func_without_stub_doc),
|
||||
('from with_python import func_without_stub', func_without_stub_sig),
|
||||
('from with_python import func_without_stub as f; f', func_without_stub_sig),
|
||||
('from with_python import func_without_stub; func_without_stub', func_without_stub_sig),
|
||||
('from with_python import func_without_stub', ''),
|
||||
('from with_python import func_without_stub as f; f', ''),
|
||||
('from with_python import func_without_stub; func_without_stub', ''),
|
||||
|
||||
('import with_python; with_python.func_with_stub', func_with_stub_doc),
|
||||
('import with_python.module; with_python.module.func_with_stub', func_with_stub_doc),
|
||||
|
||||
Reference in New Issue
Block a user