/
usr
/
lib
/
python2.6
/
site-packages
/
nose
/
/usr/lib/python2.6/site-packages/nose
mkdir
upload
Name
Size
Mode
Actions
ext/
-
0755
rm
plugins/
-
0755
rm
case.py
12508
0644
edit
dl
rm
case.pyc
14282
0644
edit
dl
rm
case.pyo
14282
0644
edit
dl
rm
commands.py
4570
0644
edit
dl
rm
commands.pyc
5003
0644
edit
dl
rm
commands.pyo
5003
0644
edit
dl
rm
config.py
20203
0644
edit
dl
rm
config.pyc
19890
0644
edit
dl
rm
config.pyo
19890
0644
edit
dl
rm
core.py
17175
0644
edit
dl
rm
core.pyc
17549
0644
edit
dl
rm
core.pyo
17549
0644
edit
dl
rm
exc.py
376
0644
edit
dl
rm
exc.pyc
576
0644
edit
dl
rm
exc.pyo
576
0644
edit
dl
rm
failure.py
850
0644
edit
dl
rm
failure.pyc
1367
0644
edit
dl
rm
failure.pyo
1367
0644
edit
dl
rm
importer.py
5490
0644
edit
dl
rm
importer.pyc
5094
0644
edit
dl
rm
importer.pyo
5094
0644
edit
dl
rm
inspector.py
6904
0644
edit
dl
rm
inspector.pyc
5925
0644
edit
dl
rm
inspector.pyo
5925
0644
edit
dl
rm
loader.py
21437
0644
edit
dl
rm
loader.pyc
16080
0644
edit
dl
rm
loader.pyo
16080
0644
edit
dl
rm
proxy.py
5840
0644
edit
dl
rm
proxy.pyc
7327
0644
edit
dl
rm
proxy.pyo
7120
0644
edit
dl
rm
result.py
5849
0644
edit
dl
rm
result.pyc
5913
0644
edit
dl
rm
result.pyo
5913
0644
edit
dl
rm
selector.py
9003
0644
edit
dl
rm
selector.pyc
8876
0644
edit
dl
rm
selector.pyo
8876
0644
edit
dl
rm
suite.py
18693
0644
edit
dl
rm
suite.pyc
18663
0644
edit
dl
rm
suite.pyo
18663
0644
edit
dl
rm
tools.py
5023
0644
edit
dl
rm
tools.pyc
7209
0644
edit
dl
rm
tools.pyo
7129
0644
edit
dl
rm
twistedtools.py
5268
0644
edit
dl
rm
twistedtools.pyc
5815
0644
edit
dl
rm
twistedtools.pyo
5815
0644
edit
dl
rm
util.py
19275
0644
edit
dl
rm
util.pyc
20125
0644
edit
dl
rm
util.pyo
20125
0644
edit
dl
rm
__init__.py
14985
0644
edit
dl
rm
__init__.pyc
15283
0644
edit
dl
rm
__init__.pyo
15283
0644
edit
dl
rm
Edit:
/usr/lib/python2.6/site-packages/nose/commands.py
(4570B)
""" nosetests setuptools command ---------------------------- You can run tests using the `nosetests` setuptools command:: python setup.py nosetests This command has one benefit over the standard `test` command: all nose plugins are supported. To configure the `nosetests` command, add a [nosetests] section to your setup.cfg. The [nosetests] section can contain any command line arguments that nosetests supports. The differences between issuing an option on the command line and adding it to setup.cfg are: * In setup.cfg, the -- prefix must be excluded * In setup.cfg, command line flags that take no arguments must be given an argument flag (1, T or TRUE for active, 0, F or FALSE for inactive) Here's an example [nosetests] setup.cfg section:: [nosetests] verbosity=1 detailed-errors=1 with-coverage=1 cover-package=nose debug=nose.loader pdb=1 pdb-failures=1 If you commonly run nosetests with a large number of options, using the nosetests setuptools command and configuring with setup.cfg can make running your tests much less tedious. (Note that the same options and format supported in setup.cfg are supported in all other config files, and the nosetests script will also load config files.) Another reason to run tests with the command is that the command will install packages listed in your `tests_require`, as well as doing a complete build of your package before running tests. For packages with dependencies or that build C extensions, using the setuptools command can be more convenient than building by hand and running the nosetests script. """ try: from setuptools import Command except ImportError: Command = nosetests = None else: from nose.config import Config, option_blacklist, user_config_files, \ flag, _bool from nose.core import TestProgram from nose.plugins import DefaultPluginManager def get_user_options(parser): """convert a optparse option list into a distutils option tuple list""" opt_list = [] for opt in parser.option_list: if opt._long_opts[0][2:] in option_blacklist: continue long_name = opt._long_opts[0][2:] if opt.action not in ('store_true', 'store_false'): long_name = long_name + "=" short_name = None if opt._short_opts: short_name = opt._short_opts[0][1:] opt_list.append((long_name, short_name, opt.help or "")) return opt_list class nosetests(Command): description = "Run unit tests using nosetests" __config = Config(files=user_config_files(), plugins=DefaultPluginManager()) __parser = __config.getParser() user_options = get_user_options(__parser) def initialize_options(self): """create the member variables, but change hyphens to underscores """ self.option_to_cmds = {} for opt in self.__parser.option_list: cmd_name = opt._long_opts[0][2:] option_name = cmd_name.replace('-', '_') self.option_to_cmds[option_name] = cmd_name setattr(self, option_name, None) self.attr = None def finalize_options(self): """nothing to do here""" pass def run(self): """ensure tests are capable of being run, then run nose.main with a reconstructed argument list""" self.run_command('egg_info') # Build extensions in-place self.reinitialize_command('build_ext', inplace=1) self.run_command('build_ext') if self.distribution.tests_require: self.distribution.fetch_build_eggs( self.distribution.tests_require) argv = ['nosetests'] for (option_name, cmd_name) in self.option_to_cmds.items(): if option_name in option_blacklist: continue value = getattr(self, option_name) if value is not None: argv.extend( self.cfgToArg(option_name.replace('_', '-'), value)) TestProgram(argv=argv, config=self.__config) def cfgToArg(self, optname, value): argv = [] if flag(value): if _bool(value): argv.append('--' + optname) else: argv.extend(['--' + optname, value]) return argv
Save
cmd:
run