diff --git a/jedi/plugins/pytest.py b/jedi/plugins/pytest.py index 910f540c..08ff0905 100644 --- a/jedi/plugins/pytest.py +++ b/jedi/plugins/pytest.py @@ -84,6 +84,8 @@ def _is_a_pytest_param(param_name): This is a heuristic and will work in most cases. """ funcdef = search_ancestor(param_name.tree_name, 'funcdef') + if funcdef is None: # A lambda + return False decorators = funcdef.get_decorators() return _is_pytest_func(funcdef.name.value, decorators) diff --git a/test/test_inference/test_imports.py b/test/test_inference/test_imports.py index 5d628d05..93582743 100644 --- a/test/test_inference/test_imports.py +++ b/test/test_inference/test_imports.py @@ -342,7 +342,7 @@ def test_get_modules_containing_name(inference_state, path, goal, is_package): ) def test_load_module_from_path(inference_state, path, base_names, is_package, names): file_io = KnownContentFileIO(path, '') - m = imports._load_module_from_path(inference_state, file_io, base_names) + m = imports.load_module_from_path(inference_state, file_io, base_names) assert m.is_package() == is_package assert m.string_names == names