Skip to content

Commit

Permalink
Modify test so that it actually reproduces the bug in #2044
Browse files Browse the repository at this point in the history
  • Loading branch information
maxalbert committed Jan 14, 2025
1 parent 61848af commit 1ce0d00
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/test_api/test_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,13 +593,14 @@ class Inherited(dict):
assert [c.complete for c in comps] == expected


def test_implicit_namespace_package_with_subpackages():
sys_path = [
get_example_dir('implicit_namespace_package_with_subpackages', 'ns1'),
get_example_dir('implicit_namespace_package_with_subpackages', 'ns2'),
]
project = Project('.', sys_path=sys_path)
interpreter = jedi.Interpreter("import pkg; pkg.", namespaces=[], project=project)
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
interpreter = jedi.Interpreter("pkg.", namespaces=[locals()], project=Project('.'))
comps = interpreter.complete()
expected = ["pkgA", "pkgB"]
assert [c.complete for c in comps] == expected
Expand Down

0 comments on commit 1ce0d00

Please sign in to comment.