From 999ec34b7965ffc0fcb7f92a1df0332af9bb1ee5 2013-09-19 22:21:13 From: Thomas Kluyver Date: 2013-09-19 22:21:13 Subject: [PATCH] Allow drilling down to individual tests using iptest command --- diff --git a/IPython/testing/iptest.py b/IPython/testing/iptest.py index ac71233..c352788 100644 --- a/IPython/testing/iptest.py +++ b/IPython/testing/iptest.py @@ -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() diff --git a/IPython/testing/iptestcontroller.py b/IPython/testing/iptestcontroller.py index 89e53f3..3b087e3 100644 --- a/IPython/testing/iptestcontroller.py +++ b/IPython/testing/iptestcontroller.py @@ -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()