mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-30 12:11:32 +08:00
Fix tests to return consistent results regardless of how they are called.
Now, calling: - 'python iptest.py' from source dir or from src/IPython/testing should give the same results - 'python iptest.py IPython.SOMETHING' from either place should also give the same results.
This commit is contained in:
parent
34dd139174
commit
5740081c62
@ -38,8 +38,6 @@ import warnings
|
|||||||
p = os.path
|
p = os.path
|
||||||
ippath = p.abspath(p.join(p.dirname(__file__),'..','..'))
|
ippath = p.abspath(p.join(p.dirname(__file__),'..','..'))
|
||||||
sys.path.insert(0, ippath)
|
sys.path.insert(0, ippath)
|
||||||
#print 'ipp:', ippath # dbg
|
|
||||||
#import IPython; print 'IP file:', IPython.__file__ # dbg
|
|
||||||
|
|
||||||
# Note: monkeypatch!
|
# Note: monkeypatch!
|
||||||
# We need to monkeypatch a small problem in nose itself first, before importing
|
# 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))
|
return os.system(' '.join(self.call_args))
|
||||||
else:
|
else:
|
||||||
def _run_cmd(self):
|
def _run_cmd(self):
|
||||||
|
#print >> sys.stderr, '*** CMD:', ' '.join(self.call_args) # dbg
|
||||||
subp = subprocess.Popen(self.call_args)
|
subp = subprocess.Popen(self.call_args)
|
||||||
self.pids.append(subp.pid)
|
self.pids.append(subp.pid)
|
||||||
# If this fails, the pid will be left in self.pids and cleaned up
|
# 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')
|
trial_pkg_names.append('kernel')
|
||||||
|
|
||||||
# For debugging this code, only load quick stuff
|
# For debugging this code, only load quick stuff
|
||||||
#nose_pkg_names = ['config', 'utils'] # dbg
|
#nose_pkg_names = ['core'] # dbg
|
||||||
#trial_pkg_names = [] # dbg
|
#trial_pkg_names = [] # dbg
|
||||||
|
|
||||||
# Make fully qualified package names prepending 'IPython.' to our name lists
|
# Make fully qualified package names prepending 'IPython.' to our name lists
|
||||||
@ -320,7 +319,20 @@ def run_iptest():
|
|||||||
warnings.filterwarnings('ignore',
|
warnings.filterwarnings('ignore',
|
||||||
'This will be removed soon. Use IPython.testing.util instead')
|
'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
|
# Loading ipdoctest causes problems with Twisted, but
|
||||||
# our test suite runner now separates things and runs
|
# our test suite runner now separates things and runs
|
||||||
# all Twisted tests with trial.
|
# all Twisted tests with trial.
|
||||||
|
Loading…
Reference in New Issue
Block a user