1
0
forked from VimPlug/jedi

Merge branch 'add-egg-links-to-syspath-on-parser' of https://github.com/blueyed/jedi into dev

This commit is contained in:
Dave Halter
2015-03-06 01:06:17 +01:00
4 changed files with 31 additions and 6 deletions

View File

@@ -0,0 +1 @@
/path/from/egg-link

View File

@@ -1,3 +1,5 @@
import os
from jedi._compatibility import unicode
from jedi.parser import Parser, load_grammar
from jedi.evaluate import sys_path, Evaluator
@@ -15,3 +17,15 @@ def test_paths_from_assignment():
# Fail for complicated examples.
assert paths('sys.path, other = ["a"], 2') == []
def test_get_sys_path(monkeypatch):
monkeypatch.setenv('VIRTUAL_ENV', os.path.join(os.path.dirname(__file__),
'egg-link', 'venv'))
def sitepackages_dir(venv):
return os.path.join(venv, 'lib', 'python3.4', 'site-packages')
monkeypatch.setattr('jedi.evaluate.sys_path._get_venv_sitepackages',
sitepackages_dir)
assert '/path/from/egg-link' in sys_path.get_sys_path()