mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-28 07:56:51 +08:00
further improvements of the jedi import in tests
This commit is contained in:
@@ -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)
|
||||
|
||||
10
test/base.py
10
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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user