forked from VimPlug/jedi
test_imports: use sys_path
This commit is contained in:
@@ -46,11 +46,8 @@ def test_flask_ext(script, name):
|
|||||||
"""flask.ext.foo is really imported from flaskext.foo or flask_foo.
|
"""flask.ext.foo is really imported from flaskext.foo or flask_foo.
|
||||||
"""
|
"""
|
||||||
path = os.path.join(os.path.dirname(__file__), 'flask-site-packages')
|
path = os.path.join(os.path.dirname(__file__), 'flask-site-packages')
|
||||||
sys.path.append(path)
|
completions = jedi.Script(script, sys_path=[path]).completions()
|
||||||
try:
|
assert name in [c.name for c in completions]
|
||||||
assert name in [c.name for c in jedi.Script(script).completions()]
|
|
||||||
finally:
|
|
||||||
sys.path.remove(path)
|
|
||||||
|
|
||||||
|
|
||||||
@cwd_at('test/test_evaluate/')
|
@cwd_at('test/test_evaluate/')
|
||||||
|
|||||||
Reference in New Issue
Block a user