From f49f4c2254b86189128005bc1183c1b99ebf1825 2010-01-07 23:58:26 From: Fernando Perez Date: 2010-01-07 23:58:26 Subject: [PATCH] Make testing easier by exposing a top-level test() function. Fixes https://bugs.launchpad.net/ipython/+bug/504450 --- diff --git a/IPython/__init__.py b/IPython/__init__.py old mode 100644 new mode 100755 index a3d3030..54c21b2 --- a/IPython/__init__.py +++ b/IPython/__init__.py @@ -42,6 +42,7 @@ sys.path.append(os.path.join(os.path.dirname(__file__), "extensions")) from IPython.core.iplib import InteractiveShell from IPython.core.embed import embed from IPython.core.error import TryNext +from IPython.testing import test from IPython.lib import ( enable_wx, disable_wx, @@ -61,4 +62,3 @@ for author, email in release.authors.values(): __license__ = release.license __version__ = release.version __revision__ = release.revision - diff --git a/IPython/testing/__init__.py b/IPython/testing/__init__.py index e69de29..830585c 100644 --- a/IPython/testing/__init__.py +++ b/IPython/testing/__init__.py @@ -0,0 +1,18 @@ +"""Testing support (tools to test IPython itself). +""" + +# User-level entry point for testing +def test(): + """Run the entire IPython test suite. + + For fine-grained control, you should use the :file:`iptest` script supplied + with the IPython installation.""" + + # Do the import internally, so that this function doesn't increase total + # import time + from iptest import run_iptestall + run_iptestall() + +# So nose doesn't try to run this as a test itself and we end up with an +# infinite test loop +test.__test__ = False