mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-19 03:55:57 +08:00
Add ranged test execution for alternate test runner.
This commit is contained in:
19
test/run.py
19
test/run.py
@@ -54,7 +54,7 @@ Alternate Test Runner
|
|||||||
If you don't like the output of ``py.test``, there's an alternate test runner
|
If you don't like the output of ``py.test``, there's an alternate test runner
|
||||||
that you can start by running ``./run.py``. The above example could be run by::
|
that you can start by running ``./run.py``. The above example could be run by::
|
||||||
|
|
||||||
./run.py basic 4 6 8
|
./run.py basic 4 6 8 50-80
|
||||||
|
|
||||||
The advantage of this runner is simplicity and more customized error reports.
|
The advantage of this runner is simplicity and more customized error reports.
|
||||||
Using both runners will help you to have a quicker overview of what's
|
Using both runners will help you to have a quicker overview of what's
|
||||||
@@ -269,9 +269,14 @@ def collect_file_tests(lines, lines_to_execute):
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
correct = None
|
correct = None
|
||||||
else:
|
else:
|
||||||
# skip the test, if this is not specified test
|
# Skip the test, if this is not specified test.
|
||||||
if lines_to_execute and line_nr not in lines_to_execute:
|
for l in lines_to_execute:
|
||||||
correct = None
|
if isinstance(l, tuple) and l[0] <= line_nr <= l[1] \
|
||||||
|
or line_nr == l:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
if lines_to_execute:
|
||||||
|
correct = None
|
||||||
|
|
||||||
|
|
||||||
def collect_dir_tests(base_dir, test_files, check_thirdparty=False):
|
def collect_dir_tests(base_dir, test_files, check_thirdparty=False):
|
||||||
@@ -335,7 +340,11 @@ if __name__ == '__main__':
|
|||||||
test_files = {}
|
test_files = {}
|
||||||
last = None
|
last = None
|
||||||
for arg in arguments['<rest>']:
|
for arg in arguments['<rest>']:
|
||||||
if arg.isdigit():
|
match = re.match('(\d+)-(\d+)', arg)
|
||||||
|
if match:
|
||||||
|
start, end = match.groups()
|
||||||
|
test_files[last].append((int(start), int(end)))
|
||||||
|
elif arg.isdigit():
|
||||||
if last is None:
|
if last is None:
|
||||||
continue
|
continue
|
||||||
test_files[last].append(int(arg))
|
test_files[last].append(int(arg))
|
||||||
|
|||||||
Reference in New Issue
Block a user