From 7d1b5074504cd5ba5e7a26b12b60a1196ae6c790 2010-01-17 00:51:30 From: Fernando Perez Date: 2010-01-17 00:51:30 Subject: [PATCH] Give good error message when starting tests if nose is missing. --- diff --git a/IPython/scripts/iptest b/IPython/scripts/iptest index ce230ce..9d4b6da 100755 --- a/IPython/scripts/iptest +++ b/IPython/scripts/iptest @@ -3,6 +3,22 @@ """IPython Test Suite Runner. """ -from IPython.testing import iptest +# The tests can't even run if nose isn't available, so might as well give the +# user a civilized error message in that case. -iptest.main() +try: + import nose +except ImportError: + error = """\ +ERROR: The IPython test suite requires nose to run. + +Please install nose on your system first and try again. +For information on installing nose, see: +http://somethingaboutorange.com/mrl/projects/nose + +Exiting.""" + import sys + print >> sys.stderr, error +else: + from IPython.testing import iptest + iptest.main()