mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
improved some run.py stuff again
This commit is contained in:
14
test/base.py
14
test/base.py
@@ -32,6 +32,20 @@ sys.argv = sys.argv[:1] + args
|
||||
summary = []
|
||||
tests_fail = 0
|
||||
|
||||
def get_test_list():
|
||||
# get test list, that should be executed
|
||||
test_files = {}
|
||||
last = None
|
||||
for arg in sys.argv[1:]:
|
||||
if arg.isdigit():
|
||||
if last is None:
|
||||
continue
|
||||
test_files[last].append(int(arg))
|
||||
else:
|
||||
test_files[arg] = []
|
||||
last = arg
|
||||
return test_files
|
||||
|
||||
class TestBase(unittest.TestCase):
|
||||
def get_script(self, src, pos, path=None):
|
||||
if pos is None:
|
||||
|
||||
15
test/run.py
15
test/run.py
@@ -154,9 +154,8 @@ def run_test(source, f_name, lines_to_execute):
|
||||
correct = None
|
||||
test_type = None
|
||||
start = None
|
||||
for line_nr, line in enumerate(StringIO(source)):
|
||||
for line_nr, line in enumerate(StringIO(source), 1):
|
||||
line = unicode(line)
|
||||
line_nr += 1
|
||||
if correct:
|
||||
r = re.match('^(\d+)\s*(.*)$', correct)
|
||||
if r:
|
||||
@@ -240,17 +239,7 @@ try:
|
||||
except ValueError:
|
||||
thirdparty = False
|
||||
|
||||
# get test list, that should be executed
|
||||
test_files = {}
|
||||
last = None
|
||||
for arg in sys.argv[1:]:
|
||||
if arg.isdigit():
|
||||
if last is None:
|
||||
continue
|
||||
test_files[last].append(int(arg))
|
||||
else:
|
||||
test_files[arg] = []
|
||||
last = arg
|
||||
test_files = base.get_test_list()
|
||||
|
||||
# completion tests:
|
||||
completion_test_dir = '../test/completion'
|
||||
|
||||
Reference in New Issue
Block a user