mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
Modify test so that it actually reproduces the bug in #2044
This commit is contained in:
@@ -593,13 +593,14 @@ def test_dict_completion(code, column, expected):
|
|||||||
assert [c.complete for c in comps] == expected
|
assert [c.complete for c in comps] == expected
|
||||||
|
|
||||||
|
|
||||||
def test_implicit_namespace_package_with_subpackages():
|
def test_implicit_namespace_package_with_subpackages(monkeypatch):
|
||||||
sys_path = [
|
sys_path_dir1 = get_example_dir('implicit_namespace_package_with_subpackages', 'ns1')
|
||||||
get_example_dir('implicit_namespace_package_with_subpackages', 'ns1'),
|
sys_path_dir2 = get_example_dir('implicit_namespace_package_with_subpackages', 'ns2')
|
||||||
get_example_dir('implicit_namespace_package_with_subpackages', 'ns2'),
|
monkeypatch.syspath_prepend(sys_path_dir1)
|
||||||
]
|
monkeypatch.syspath_prepend(sys_path_dir2)
|
||||||
project = Project('.', sys_path=sys_path)
|
|
||||||
interpreter = jedi.Interpreter("import pkg; pkg.", namespaces=[], project=project)
|
import pkg
|
||||||
|
interpreter = jedi.Interpreter("pkg.", namespaces=[locals()], project=Project('.'))
|
||||||
comps = interpreter.complete()
|
comps = interpreter.complete()
|
||||||
expected = ["pkgA", "pkgB"]
|
expected = ["pkgA", "pkgB"]
|
||||||
assert [c.complete for c in comps] == expected
|
assert [c.complete for c in comps] == expected
|
||||||
|
|||||||
Reference in New Issue
Block a user