diff --git a/test/not_in_sys_path/not_in_sys_path_package/__init__.py b/test/not_in_sys_path/not_in_sys_path_package/__init__.py new file mode 100644 index 00000000..5ef1a749 --- /dev/null +++ b/test/not_in_sys_path/not_in_sys_path_package/__init__.py @@ -0,0 +1 @@ +value = 'package' diff --git a/test/not_in_sys_path/not_in_sys_path_package/module.py b/test/not_in_sys_path/not_in_sys_path_package/module.py new file mode 100644 index 00000000..364dd035 --- /dev/null +++ b/test/not_in_sys_path/not_in_sys_path_package/module.py @@ -0,0 +1 @@ +value = 'package.module' diff --git a/test/not_in_sys_path/pkg/module.py b/test/not_in_sys_path/pkg/module.py index 0be2f1f8..c2d3b682 100644 --- a/test/not_in_sys_path/pkg/module.py +++ b/test/not_in_sys_path/pkg/module.py @@ -1,3 +1,7 @@ import not_in_sys_path +import not_in_sys_path_package +from not_in_sys_path_package import module not_in_sys_path.value +not_in_sys_path_package.value +module.value diff --git a/test/test_imports.py b/test/test_imports.py index fbb1ca1c..ef62b18f 100644 --- a/test/test_imports.py +++ b/test/test_imports.py @@ -17,5 +17,10 @@ def test_import_not_in_sys_path(): """ non-direct imports (not in sys.path) """ - a = jedi.Script(path='module.py', line=3).goto_definitions() + a = jedi.Script(path='module.py', line=5).goto_definitions() assert a[0].name == 'int' + + a = jedi.Script(path='module.py', line=6).goto_definitions() + assert a[0].name == 'str' + a = jedi.Script(path='module.py', line=7).goto_definitions() + assert a[0].name == 'str'