test for imports that are not in the sys.path.

This commit is contained in:
David Halter
2013-10-07 21:43:23 +04:30
parent b6c30b542a
commit b357c099bc
3 changed files with 16 additions and 2 deletions

View File

@@ -0,0 +1 @@
value = 3

View File

@@ -0,0 +1,3 @@
import not_in_sys_path
not_in_sys_path.value

View File

@@ -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'