mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
run buildout detection only once per buildout script
in order to avoid running into the max recursion limit.
This commit is contained in:
@@ -4,6 +4,7 @@ from textwrap import dedent
|
||||
from jedi._compatibility import u
|
||||
from jedi.evaluate.sys_path import (_get_parent_dir_with_file,
|
||||
_get_buildout_scripts,
|
||||
sys_path_with_modifications,
|
||||
_check_module)
|
||||
from jedi.evaluate import Evaluator
|
||||
from jedi.parser import Parser, load_grammar
|
||||
@@ -53,6 +54,18 @@ def test_path_from_invalid_sys_path_assignment():
|
||||
assert 'invalid' not in paths
|
||||
|
||||
|
||||
@cwd_at('test/test_evaluate/buildout_project/src/proj_name/')
|
||||
def test_sys_path_with_modifications():
|
||||
SRC = dedent(u("""
|
||||
import os
|
||||
"""))
|
||||
grammar = load_grammar()
|
||||
p = Parser(grammar, SRC)
|
||||
p.module.path = os.path.abspath(os.path.join(os.curdir, 'module_name.py'))
|
||||
paths = sys_path_with_modifications(Evaluator(grammar), p.module)
|
||||
assert '/tmp/.buildout/eggs/important_package.egg' in paths
|
||||
|
||||
|
||||
def test_path_from_sys_path_assignment():
|
||||
SRC = dedent(u("""
|
||||
#!/usr/bin/python
|
||||
|
||||
Reference in New Issue
Block a user