From 17bec929bbce6dbfed758ab8d9114936be766d87 Mon Sep 17 00:00:00 2001 From: David Halter Date: Mon, 31 Dec 2012 12:36:33 +0100 Subject: [PATCH] fix a little import problem in regression tests --- jedi/fast_parser.py | 1 + test/run.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/jedi/fast_parser.py b/jedi/fast_parser.py index a4f15a4a..839090ee 100644 --- a/jedi/fast_parser.py +++ b/jedi/fast_parser.py @@ -226,6 +226,7 @@ class FastParser(use_metaclass(CachedFastParser)): parser_order = 0 for code_part in parts: 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: # check if code_part has already been parsed h = hash(code_part) diff --git a/test/run.py b/test/run.py index 9ff9be74..9409f983 100755 --- a/test/run.py +++ b/test/run.py @@ -14,7 +14,7 @@ from _compatibility import unicode, StringIO, reduce, literal_eval, is_py25 import api 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): @@ -215,10 +215,11 @@ def test_dir(completion_test_dir, thirdparty=False): continue if thirdparty: + lib = f_name.replace('_.py', '') try: # there is always an underline at the end. # It looks like: completion/thirdparty/pylab_.py - __import__(f_name.replace('_.py', '')) + __import__(lib) except ImportError: summary.append('Thirdparty-Library %s not found.' % f_name)