mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 14:54:47 +08:00
fix a little import problem in regression tests
This commit is contained in:
@@ -226,6 +226,7 @@ class FastParser(use_metaclass(CachedFastParser)):
|
|||||||
parser_order = 0
|
parser_order = 0
|
||||||
for code_part in parts:
|
for code_part in parts:
|
||||||
lines = code_part.count('\n')
|
lines = code_part.count('\n')
|
||||||
|
# the parser is using additional newlines, therefore substract
|
||||||
if p is None or line_offset >= p.end_pos[0] - 2:
|
if p is None or line_offset >= p.end_pos[0] - 2:
|
||||||
# check if code_part has already been parsed
|
# check if code_part has already been parsed
|
||||||
h = hash(code_part)
|
h = hash(code_part)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ from _compatibility import unicode, StringIO, reduce, literal_eval, is_py25
|
|||||||
import api
|
import api
|
||||||
import debug
|
import debug
|
||||||
|
|
||||||
sys.path.pop() # pop again, because it might affect the completion
|
sys.path.pop(0) # pop again, because it might affect the completion
|
||||||
|
|
||||||
|
|
||||||
def run_completion_test(script, correct, line_nr):
|
def run_completion_test(script, correct, line_nr):
|
||||||
@@ -215,10 +215,11 @@ def test_dir(completion_test_dir, thirdparty=False):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if thirdparty:
|
if thirdparty:
|
||||||
|
lib = f_name.replace('_.py', '')
|
||||||
try:
|
try:
|
||||||
# there is always an underline at the end.
|
# there is always an underline at the end.
|
||||||
# It looks like: completion/thirdparty/pylab_.py
|
# It looks like: completion/thirdparty/pylab_.py
|
||||||
__import__(f_name.replace('_.py', ''))
|
__import__(lib)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
summary.append('Thirdparty-Library %s not found.' %
|
summary.append('Thirdparty-Library %s not found.' %
|
||||||
f_name)
|
f_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user