forked from VimPlug/jedi
test for imports that are not in the sys.path.
This commit is contained in:
1
test/not_in_sys_path/not_in_sys_path.py
Normal file
1
test/not_in_sys_path/not_in_sys_path.py
Normal file
@@ -0,0 +1 @@
|
||||
value = 3
|
||||
3
test/not_in_sys_path/pkg/module.py
Normal file
3
test/not_in_sys_path/pkg/module.py
Normal file
@@ -0,0 +1,3 @@
|
||||
import not_in_sys_path
|
||||
|
||||
not_in_sys_path.value
|
||||
@@ -1,8 +1,8 @@
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
import jedi
|
||||
from jedi._compatibility import find_module_py33
|
||||
from .helpers import cwd_at
|
||||
|
||||
|
||||
@pytest.mark.skipif('sys.version_info < (3,3)')
|
||||
@@ -10,3 +10,13 @@ def test_find_module_py33():
|
||||
"""Needs to work like the old find_module."""
|
||||
print(find_module_py33('_io'))
|
||||
assert find_module_py33('_io') == (None, '_io', False)
|
||||
|
||||
|
||||
@cwd_at('test/not_in_sys_path/pkg')
|
||||
def test_import_not_in_sys_path():
|
||||
"""
|
||||
non-direct imports (not in sys.path)
|
||||
"""
|
||||
jedi.set_debug_function()
|
||||
a = jedi.Script(path='module.py', line=3).goto_definitions()
|
||||
assert a[0].name == 'int'
|
||||
|
||||
Reference in New Issue
Block a user