mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-27 23:51:26 +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 .api import Script, NotFoundError, set_debug_function, _quick_complete
|
||||||
from . import settings
|
from . import settings
|
||||||
|
|
||||||
from . import api
|
|
||||||
|
|
||||||
del api
|
|
||||||
|
|
||||||
sys.path.pop(0)
|
sys.path.pop(0)
|
||||||
|
|||||||
10
test/base.py
10
test/base.py
@@ -5,11 +5,11 @@ import sys
|
|||||||
import os
|
import os
|
||||||
from os.path import abspath, dirname
|
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')
|
os.chdir(os.path.dirname(os.path.abspath(__file__)) + '/../jedi')
|
||||||
|
|
||||||
from jedi import api
|
import jedi
|
||||||
import debug
|
from jedi import debug
|
||||||
|
|
||||||
test_sum = 0
|
test_sum = 0
|
||||||
t_start = time.time()
|
t_start = time.time()
|
||||||
@@ -25,7 +25,7 @@ except ValueError:
|
|||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
print_debug = True
|
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
|
sys.argv = sys.argv[:1] + args
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ class TestBase(unittest.TestCase):
|
|||||||
if pos is None:
|
if pos is None:
|
||||||
lines = src.splitlines()
|
lines = src.splitlines()
|
||||||
pos = len(lines), len(lines[-1])
|
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):
|
def get_def(self, src, pos=None):
|
||||||
script = self.get_script(src, pos)
|
script = self.get_script(src, pos)
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import itertools
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from base import TestBase
|
from base import TestBase
|
||||||
from jedi._compatibility import is_py25, utf8, unicode
|
|
||||||
|
|
||||||
import jedi
|
import jedi
|
||||||
|
from jedi._compatibility import is_py25, utf8, unicode
|
||||||
from jedi import api
|
from jedi import api
|
||||||
|
|
||||||
#jedi.set_debug_function(jedi.debug.print_to_stdout)
|
#jedi.set_debug_function(jedi.debug.print_to_stdout)
|
||||||
|
|||||||
Reference in New Issue
Block a user