Fix tests

This commit is contained in:
Dave Halter
2019-12-27 13:30:53 +01:00
parent 7715655c96
commit 0931c5492d
2 changed files with 3 additions and 1 deletions

View File

@@ -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)

View File

@@ -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