From 296eecde56ce95313bc7d93b5c9d00a4521241a3 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Mon, 9 Sep 2013 10:48:29 -0700 Subject: [PATCH] Allow drilling down to individual tests using iptest command --- IPython/testing/iptest.py | 11 ++++++++--- IPython/testing/iptestcontroller.py | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/IPython/testing/iptest.py b/IPython/testing/iptest.py index ac71233af..c352788e2 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 89e53f3e0..3b087e371 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()