diff --git a/IPython/testing/iptest.py b/IPython/testing/iptest.py index df4b41e..8900099 100644 --- a/IPython/testing/iptest.py +++ b/IPython/testing/iptest.py @@ -38,8 +38,6 @@ import warnings p = os.path ippath = p.abspath(p.join(p.dirname(__file__),'..','..')) sys.path.insert(0, ippath) -#print 'ipp:', ippath # dbg -#import IPython; print 'IP file:', IPython.__file__ # dbg # Note: monkeypatch! # We need to monkeypatch a small problem in nose itself first, before importing @@ -240,6 +238,7 @@ class IPTester(object): return os.system(' '.join(self.call_args)) else: def _run_cmd(self): + #print >> sys.stderr, '*** CMD:', ' '.join(self.call_args) # dbg subp = subprocess.Popen(self.call_args) self.pids.append(subp.pid) # If this fails, the pid will be left in self.pids and cleaned up @@ -295,7 +294,7 @@ def make_runners(): trial_pkg_names.append('kernel') # For debugging this code, only load quick stuff - #nose_pkg_names = ['config', 'utils'] # dbg + #nose_pkg_names = ['core'] # dbg #trial_pkg_names = [] # dbg # Make fully qualified package names prepending 'IPython.' to our name lists @@ -320,7 +319,20 @@ def run_iptest(): warnings.filterwarnings('ignore', 'This will be removed soon. Use IPython.testing.util instead') - argv = sys.argv + [ '--detailed-errors', + argv = sys.argv + [ '--detailed-errors', # extra info in tracebacks + + # I don't fully understand why we need this one, but + # depending on what directory the test suite is run + # from, if we don't give it, 0 tests get run. + # Specifically, if the test suite is run from the + # source dir with an argument (like 'iptest.py + # IPython.core', 0 tests are run, even if the same call + # done in this directory works fine). It appears that + # if the requested package is in the current dir, + # nose bails early by default. Since it's otherwise + # harmless, leave it in by default. + '--traverse-namespace', + # Loading ipdoctest causes problems with Twisted, but # our test suite runner now separates things and runs # all Twisted tests with trial. diff --git a/IPython/utils/platutils_posix.py b/IPython/utils/platutils_posix.py index 9a6a62d..efcc327 100644 --- a/IPython/utils/platutils_posix.py +++ b/IPython/utils/platutils_posix.py @@ -49,7 +49,7 @@ else: def find_cmd(cmd): """Find the full path to a command using which.""" - return getoutputerror('which %s' % cmd)[0] + return getoutputerror('/usr/bin/env which %s' % cmd)[0] def get_long_path_name(path): diff --git a/iptest.py b/iptest.py index 7c22381..236cb16 100755 --- a/iptest.py +++ b/iptest.py @@ -2,13 +2,17 @@ """Test script for IPython. The actual ipython test script to be installed with 'python setup.py install' -is in './scripts' directory. This file is here (ipython source root directory) -to facilitate non-root 'zero-installation testing' (just copy the source tree -somewhere and run ipython.py) and development. +is in './scripts' directory, and will test IPython from an importable +location. + +This file is here (ipython source root directory) to facilitate non-root +'zero-installation testing and development' (just copy the source tree +somewhere and run iptest.py). You can run this script directly, type -h to see all options.""" -# Ensure that the imported IPython is the local one, not a system-wide one +# Ensure that the imported IPython packages come from *THIS* IPython, not some +# other one that may exist system-wide import os, sys this_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, this_dir)