From 869572fe64923200110e11afdcb6cc14443bfa2b Mon Sep 17 00:00:00 2001 From: David Halter Date: Tue, 8 Jan 2013 12:29:17 +0100 Subject: [PATCH] further improvements of the jedi import in tests --- jedi/__init__.py | 4 ---- test/base.py | 10 +++++----- test/regression.py | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/jedi/__init__.py b/jedi/__init__.py index db5869ef..07b09aa8 100644 --- a/jedi/__init__.py +++ b/jedi/__init__.py @@ -32,8 +32,4 @@ sys.path.insert(0, __path__[0]) from .api import Script, NotFoundError, set_debug_function, _quick_complete from . import settings -from . import api - -del api - sys.path.pop(0) diff --git a/test/base.py b/test/base.py index dbb8d010..21ad78d7 100644 --- a/test/base.py +++ b/test/base.py @@ -5,11 +5,11 @@ import sys import os from os.path import abspath, dirname -sys.path.insert(0, abspath(dirname(abspath(__file__)) + '/../')) +sys.path.insert(0, abspath(dirname(abspath(__file__)) + '/..')) os.chdir(os.path.dirname(os.path.abspath(__file__)) + '/../jedi') -from jedi import api -import debug +import jedi +from jedi import debug test_sum = 0 t_start = time.time() @@ -25,7 +25,7 @@ except ValueError: pass else: print_debug = True - api.set_debug_function(debug.print_to_stdout) + jedi.set_debug_function(debug.print_to_stdout) sys.argv = sys.argv[:1] + args @@ -51,7 +51,7 @@ class TestBase(unittest.TestCase): if pos is None: lines = src.splitlines() pos = len(lines), len(lines[-1]) - return api.Script(src, pos[0], pos[1], path) + return jedi.Script(src, pos[0], pos[1], path) def get_def(self, src, pos=None): script = self.get_script(src, pos) diff --git a/test/regression.py b/test/regression.py index 78b6f51c..c7f4c3e2 100755 --- a/test/regression.py +++ b/test/regression.py @@ -7,9 +7,9 @@ import itertools import os from base import TestBase -from jedi._compatibility import is_py25, utf8, unicode import jedi +from jedi._compatibility import is_py25, utf8, unicode from jedi import api #jedi.set_debug_function(jedi.debug.print_to_stdout)