mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Fix tests
This commit is contained in:
@@ -84,6 +84,8 @@ def _is_a_pytest_param(param_name):
|
|||||||
This is a heuristic and will work in most cases.
|
This is a heuristic and will work in most cases.
|
||||||
"""
|
"""
|
||||||
funcdef = search_ancestor(param_name.tree_name, 'funcdef')
|
funcdef = search_ancestor(param_name.tree_name, 'funcdef')
|
||||||
|
if funcdef is None: # A lambda
|
||||||
|
return False
|
||||||
decorators = funcdef.get_decorators()
|
decorators = funcdef.get_decorators()
|
||||||
return _is_pytest_func(funcdef.name.value, decorators)
|
return _is_pytest_func(funcdef.name.value, decorators)
|
||||||
|
|
||||||
|
|||||||
@@ -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):
|
def test_load_module_from_path(inference_state, path, base_names, is_package, names):
|
||||||
file_io = KnownContentFileIO(path, '')
|
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.is_package() == is_package
|
||||||
assert m.string_names == names
|
assert m.string_names == names
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user