mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Fix remaining tests
This commit is contained in:
@@ -266,8 +266,8 @@ def get_module_contexts_containing_name(inference_state, module_contexts, name,
|
||||
if m is not None:
|
||||
parsed_file_count += 1
|
||||
yield m
|
||||
if parsed_file_count > parse_limit:
|
||||
if parsed_file_count >= parse_limit:
|
||||
break
|
||||
|
||||
if file_io_count > open_limit:
|
||||
if file_io_count >= open_limit:
|
||||
break
|
||||
|
||||
@@ -5,7 +5,9 @@ def test_import_references(Script):
|
||||
|
||||
def test_exclude_builtin_modules(Script):
|
||||
def get(include):
|
||||
references = Script(source).find_references(column=8, include_builtins=include)
|
||||
from jedi.api.project import Project
|
||||
script = Script(source, _project=Project('', sys_path=[]))
|
||||
references = script.find_references(column=8, include_builtins=include)
|
||||
return [(d.line, d.column) for d in references]
|
||||
source = '''import sys\nprint(sys.path)'''
|
||||
places = get(include=True)
|
||||
|
||||
@@ -307,8 +307,13 @@ def test_compiled_import_none(monkeypatch, Script):
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
('path', 'is_package', 'goal'), [
|
||||
(os.path.join(THIS_DIR, 'test_docstring.py'), False, ('ok', 'lala', 'test_imports')),
|
||||
(os.path.join(THIS_DIR, '__init__.py'), True, ('ok', 'lala', 'x', 'test_imports')),
|
||||
# Both of these tests used to return relative paths to the module
|
||||
# context that was initially given, but now we just work with the file
|
||||
# system.
|
||||
(os.path.join(THIS_DIR, 'test_docstring.py'), False,
|
||||
('test', 'test_inference', 'test_imports')),
|
||||
(os.path.join(THIS_DIR, '__init__.py'), True,
|
||||
('test', 'test_inference', 'test_imports')),
|
||||
]
|
||||
)
|
||||
def test_get_modules_containing_name(inference_state, path, goal, is_package):
|
||||
|
||||
Reference in New Issue
Block a user