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 = []
|
summary = []
|
||||||
tests_fail = 0
|
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):
|
class TestBase(unittest.TestCase):
|
||||||
def get_script(self, src, pos, path=None):
|
def get_script(self, src, pos, path=None):
|
||||||
if pos is 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
|
correct = None
|
||||||
test_type = None
|
test_type = None
|
||||||
start = None
|
start = None
|
||||||
for line_nr, line in enumerate(StringIO(source)):
|
for line_nr, line in enumerate(StringIO(source), 1):
|
||||||
line = unicode(line)
|
line = unicode(line)
|
||||||
line_nr += 1
|
|
||||||
if correct:
|
if correct:
|
||||||
r = re.match('^(\d+)\s*(.*)$', correct)
|
r = re.match('^(\d+)\s*(.*)$', correct)
|
||||||
if r:
|
if r:
|
||||||
@@ -240,17 +239,7 @@ try:
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
thirdparty = False
|
thirdparty = False
|
||||||
|
|
||||||
# get test list, that should be executed
|
test_files = base.get_test_list()
|
||||||
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
|
|
||||||
|
|
||||||
# completion tests:
|
# completion tests:
|
||||||
completion_test_dir = '../test/completion'
|
completion_test_dir = '../test/completion'
|
||||||
|
|||||||
Reference in New Issue
Block a user