add test for namespaced packages
This commit is contained in:
1 parent
1fa16337b7
commit
4fbde0001a
4 files changed
+17
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,4 @@
|
|||||||
|
try:
|
||||||
|
__import__('pkg_resources').declare_namespace(__name__)
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
CONST = 1
|
||||||
@@ -51,3 +51,15 @@ def test_namespace_package():
|
|||||||
completion = c
|
completion = c
|
||||||
solution = "statement: foo = '%s'" % solution
|
solution = "statement: foo = '%s'" % solution
|
||||||
assert completion.description == solution
|
assert completion.description == solution
|
||||||
|
|
||||||
|
|
||||||
|
def test_nested_namespace_package():
|
||||||
|
CODE = 'from nested_namespaces.namespace.pkg import CONST'
|
||||||
|
|
||||||
|
sys_path = [dirname(__file__)]
|
||||||
|
|
||||||
|
script = jedi.Script(sys_path=sys_path, source=CODE, line=1, column=45)
|
||||||
|
|
||||||
|
result = script.goto_definitions()
|
||||||
|
|
||||||
|
assert len(result) == 1
|
||||||
Reference in new issue
Block a user