Make sure the monkeypatch fixture completion works

This commit is contained in:
Dave Halter
2019-12-27 16:13:20 +01:00
parent b4163a3912
commit e86487cb96
2 changed files with 21 additions and 0 deletions

View File

@@ -5,6 +5,10 @@ from jedi.inference.imports import load_module_from_path
from jedi.inference.filters import ParserTreeFilter
from jedi.inference.base_value import NO_VALUES, ValueSet
_PYTEST_FIXTURE_MODULES = [
('_pytest', 'monkeypatch')
]
def execute(callback):
def wrapper(value, arguments):
@@ -110,6 +114,10 @@ def _iter_pytest_modules(module_context):
pass
folder = folder.get_parent_folder()
for names in _PYTEST_FIXTURE_MODULES:
for module_value in module_context.inference_state.import_module(names):
yield module_value.as_context()
class FixtureFilter(ParserTreeFilter):
def _filter(self, names):