Allow drilling down to individual tests using iptest command

This commit is contained in:
Thomas Kluyver 2013-09-09 10:48:29 -07:00
parent 1427c61097
commit 296eecde56
2 changed files with 10 additions and 4 deletions

View File

@ -368,8 +368,13 @@ def run_iptest():
warnings.filterwarnings('ignore',
'This will be removed soon. Use IPython.testing.util instead')
section = test_sections[sys.argv[1]]
sys.argv[1:2] = section.includes
if sys.argv[1] in test_sections:
section = test_sections[sys.argv[1]]
sys.argv[1:2] = section.includes
else:
arg1 = sys.argv[1]
section = TestSection(arg1, includes=[arg1])
argv = sys.argv + [ '--detailed-errors', # extra info in tracebacks
@ -413,7 +418,7 @@ def run_iptest():
# assumptions about what needs to be a singleton and what doesn't (app
# objects should, individual shells shouldn't). But for now, this
# workaround allows the test suite for the inprocess module to complete.
if section.name != 'kernel.inprocess':
if 'kernel.inprocess' not in section.name:
from IPython.testing import globalipapp
globalipapp.start_ipython()

View File

@ -349,7 +349,8 @@ def run_iptestall(inc_slow=False, jobs=1, xunit_out=False, coverage_out=False):
def main():
if len(sys.argv) > 1 and (sys.argv[1] in test_sections):
if len(sys.argv) > 1 and \
((sys.argv[1] in test_sections) or sys.argv[1].startswith('IPython')):
from .iptest import run_iptest
# This is in-process
run_iptest()