From 90a08794bae11f453728aa3db885e4d381eccb99 Mon Sep 17 00:00:00 2001 From: immerrr Date: Wed, 21 Oct 2015 17:35:28 +0300 Subject: [PATCH] test_imports: use sys_path --- test/test_evaluate/test_imports.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/test_evaluate/test_imports.py b/test/test_evaluate/test_imports.py index de913a4e..9ebc968d 100644 --- a/test/test_evaluate/test_imports.py +++ b/test/test_evaluate/test_imports.py @@ -46,11 +46,8 @@ def test_flask_ext(script, name): """flask.ext.foo is really imported from flaskext.foo or flask_foo. """ path = os.path.join(os.path.dirname(__file__), 'flask-site-packages') - sys.path.append(path) - try: - assert name in [c.name for c in jedi.Script(script).completions()] - finally: - sys.path.remove(path) + completions = jedi.Script(script, sys_path=[path]).completions() + assert name in [c.name for c in completions] @cwd_at('test/test_evaluate/')