1
0
forked from VimPlug/jedi

Make completion of pytest fixtures possible

This commit is contained in:
Dave Halter
2019-12-27 12:29:18 +01:00
parent 8611fcf8ea
commit 31936776a5
3 changed files with 40 additions and 1 deletions

View File

@@ -53,6 +53,18 @@ def goto_anonymous_param(func):
return wrapper
def complete_param_names(func):
def wrapper(context, func_name):
module_context = context.get_root_context()
names = []
for module_context in _iter_pytest_modules(module_context):
names += FixtureFilter(module_context).values()
if names:
return names
return func(context, func_name)
return wrapper
def _goto_pytest_fixture(module_context, name):
for module_context in _iter_pytest_modules(module_context):
names = FixtureFilter(module_context).get(name)