mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
Improve virtualenv support & egg-link resolution
- add sys_path= kwarg to Script & Evaluator constructors - store sys_path for each evaluator instance - replace get_sys_path with get_venv_path - get_venv_path: use addsitedir to load .pth extension files - get_venv_path: look for egg-link files in all directories in path
This commit is contained in:
@@ -66,8 +66,9 @@ class TestRegression(TestCase):
|
||||
src1 = "def r(a): return a"
|
||||
# Other fictional modules in another place in the fs.
|
||||
src2 = 'from .. import setup; setup.r(1)'
|
||||
imports.load_module(os.path.abspath(fname), src2)
|
||||
result = Script(src1, path='../setup.py').goto_definitions()
|
||||
script = Script(src1, path='../setup.py')
|
||||
imports.load_module(script._evaluator, os.path.abspath(fname), src2)
|
||||
result = script.goto_definitions()
|
||||
assert len(result) == 1
|
||||
assert result[0].description == 'class int'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user