diff options
author | Pearu Peterson <pearu.peterson@gmail.com> | 2007-07-20 09:28:37 +0000 |
---|---|---|
committer | Pearu Peterson <pearu.peterson@gmail.com> | 2007-07-20 09:28:37 +0000 |
commit | f20f87bbfde7a5feabeb428d8db309b2f5dcc67d (patch) | |
tree | 2e7403b8431d42f4c1969b52b96f03141db79452 /numpy/testing/numpytest.py | |
parent | c41545e98af71cf97741713665e365bd4f0aef12 (diff) | |
download | numpy-f20f87bbfde7a5feabeb428d8db309b2f5dcc67d.tar.gz |
Added a new option to NumpyTest.run command line: -s somestring will replace sys.argv\[1:\] with splitcmdline(somestring)
Diffstat (limited to 'numpy/testing/numpytest.py')
-rw-r--r-- | numpy/testing/numpytest.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/numpy/testing/numpytest.py b/numpy/testing/numpytest.py index da09a830d..41efb60ad 100644 --- a/numpy/testing/numpytest.py +++ b/numpy/testing/numpytest.py @@ -16,6 +16,7 @@ __all__ = ['set_package_path', 'set_local_path', 'restore_path', DEBUG=0 from numpy.testing.utils import jiffies +from numpy.distutils.exec_command import splitcmdline get_frame = sys._getframe class IgnoreException(Exception): @@ -605,7 +606,7 @@ class NumpyTest: except ImportError: self.warn('Failed to import optparse module, ignoring.') return self.test() - usage = r'usage: %prog [-v <verbosity>] [-l <level>]' + usage = r'usage: %prog [-v <verbosity>] [-l <level>] [-s "<replacement of sys.argv[1:]>"]' parser = OptionParser(usage) parser.add_option("-v", "--verbosity", action="store", @@ -617,7 +618,14 @@ class NumpyTest: dest="level", default=1, type='int') + parser.add_option("-s", "--sys-argv", + action="store", + dest="sys_argv", + default='', + type='string') (options, args) = parser.parse_args() + if options.sys_argv: + sys.argv[1:] = splitcmdline(options.sys_argv) self.test(options.level,options.verbosity) return |