This commit is contained in:
maxalbert
2025-01-14 20:35:35 +00:00
committed by GitHub
3 changed files with 19 additions and 0 deletions

View File

@@ -9,8 +9,10 @@ import pytest
import jedi
import jedi.settings
from jedi import Project
from jedi.inference.compiled import mixed
from importlib import import_module
from test.helpers import get_example_dir
class _GlobalNameSpace:
@@ -591,6 +593,23 @@ def test_dict_completion(code, column, expected):
assert [c.complete for c in comps] == expected
def test_implicit_namespace_package_with_subpackages(monkeypatch):
sys_path_dir1 = get_example_dir('implicit_namespace_package_with_subpackages', 'ns1')
sys_path_dir2 = get_example_dir('implicit_namespace_package_with_subpackages', 'ns2')
monkeypatch.syspath_prepend(sys_path_dir1)
monkeypatch.syspath_prepend(sys_path_dir2)
import pkg_implicit_namespace_package_test
interpreter = jedi.Interpreter(
"pkg_implicit_namespace_package_test.",
namespaces=[locals()],
project=Project('.')
)
comps = interpreter.complete()
expected = ["pkgA", "pkgB"]
assert [c.complete for c in comps] == expected
@pytest.mark.parametrize(
'code, types', [
('dct[1]', ['int']),