python:nosetest
上一篇 / 下一篇 2011-08-30 15:56:23 / 个人分类:python
nosetests -h >d:\nosetests.txt
Usage: nosetests-script.py [options]
Options:
-h, --help show this help message and exit
-V, --version Output nose version and exit
-p, --plugins Output list of available plugins and exit. Combine
with higher verbosity for greater detail
-v, --verbose Be more verbose. [NOSE_VERBOSE]
--verbosity=VERBOSITY
Set verbosity; --verbosity=2 is the same as -v
-q, --quiet Be less verbose
-c FILES, --config=FILES
Load configuration from config file(s). May be
specified multiple times; in that case, all config
files will be loaded and combined
-w WHERE, --where=WHERE
Look for tests in this directory. May be specified
multiple times. The first directory passed will be
used as the working directory, in place of the current
working directory, which is the default. Others will
be added to the list of tests to execute. [NOSE_WHERE]
--py3where=PY3WHERE Look for tests in this directory under Python 3.x.
Functions the same as 'where', but only applies if
running under Python 3.x or above. Note that, if
present under 3.x, this option completely replaces any
directories specified with 'where', so the 'where'
option becomes ineffective. [NOSE_PY3WHERE]
-m REGEX, --match=REGEX, --testmatch=REGEX
Files, directories, function names, and class names
that match this regular expression are considered
tests. Default: (?:^|[\b_\.\-])[Tt]est
[NOSE_TESTMATCH]
--tests=NAMES Run these tests (comma-separated list). This argument
is useful mainly from configuration files; on the
command line, just pass the tests to run as additional
arguments with no switch.
-l DEBUG, --debug=DEBUG
Activate debug logging for one or more systems.
Available debug loggers: nose, nose.importer,
nose.inspector, nose.plugins, nose.result and
nose.selector. Separate multiple names with a comma.
--debug-log=FILE Log debug messages to this file (default: sys.stderr)
--logging-config=FILE, --log-config=FILE
Load logging config from this file -- bypasses all
other logging config settings.
-e REGEX, --exclude=REGEX
Don't run tests that match regular expression
[NOSE_EXCLUDE]
-i REGEX, --include=REGEX
This regular expression will be applied to files,
directories, function names, and class names for a
chance to include additional tests that do not match
TESTMATCH. Specify this option multiple times to add
more regular expressions [NOSE_INCLUDE]
-x, --stop Stop running tests after the first error or failure
-P, --no-path-adjustment
Don't make any changes to sys.path when loading tests
[NOSE_NOPATH]
--exe Look for tests in python modules that are executable.
Normal behavior. is to exclude executable modules,
since they may not be import-safe [NOSE_INCLUDE_EXE]
--noexe DO NOT look for tests in python modules that are
executable. (The default on the windows platform. is to
do so.)
--traverse-namespace Traverse through all path entries of a namespace
package
--first-package-wins=FIRSTPACKAGEWINS, --first-pkg-wins=FIRSTPACKAGEWINS, --1st-pkg-wins=FIRSTPACKAGEWINS
nose's importer will normally evict a package from
sys.modules if it sees a package with the same name in
a different location. Set this option to disable that
behavior.
-a ATTR, --attr=ATTR Run only tests that have attributes specified by ATTR
[NOSE_ATTR]
-A EXPR, --eval-attr=EXPR
Run only tests for whose attributes the Python
expression EXPR evaluates to True [NOSE_EVAL_ATTR]
-s, --nocapture Don't capture stdout (any stdout output will be
printed immediately) [NOSE_NOCAPTURE]
-s, 不捕获输出,会让你的程序里面的一些命令行上的输出显示出来。例如print所输出的内容。
--nologcapture Disable logging capture plugin. Logging configurtion
will be left intact. [NOSE_NOLOGCAPTURE]
--logging-format=FORMAT
Specify custom format to print statements. Uses the
same format as used by standard logging handlers.
[NOSE_LOGFORMAT]
--logging-datefmt=FORMAT
Specify custom date/time format to print statements.
Uses the same format as used by standard logging
handlers. [NOSE_LOGDATEFMT]
--logging-filter=FILTER
Specify which statements to filter in/out. By default,
everything is captured. If the output is too verbose,
use this option to filter out needless output.
Example: filter=foo will capture statements issued
ONLY to foo or foo.what.ever.sub but not foobar or
other logger. Specify multiple loggers with comma:
filter=foo,bar,baz. If any logger name is prefixed
with a minus, eg filter=-foo, it will be excluded
rather than included. Default: exclude logging
messages from nose itself (-nose). [NOSE_LOGFILTER]
--logging-clear-handlers
Clear all other logging handlers
--with-coverage Enable plugin Coverage: Activate a coverage report
using Ned Batchelder's coverage module.
[NOSE_WITH_COVERAGE]
--cover-package=PACKAGE
Restrict coverage output to selected packages
[NOSE_COVER_PACKAGE]
--cover-erase Erase previously collected coverage statistics before
run
--cover-tests Include test modules in coverage report
[NOSE_COVER_TESTS]
--cover-inclusive Include all python files under working directory in
coverage report. Useful for discovering holes in test
coverage if not all files are imported by the test
suite. [NOSE_COVER_INCLUSIVE]
--cover-html Produce HTML coverage information
--cover-html-dir=DIR Produce HTML coverage information in dir
--pdb Drop into debugger on errors
--pdb-failures Drop into debugger on failures
--no-deprecated Disable special handling of DeprecatedTest exceptions.
--with-doctest Enable plugin Doctest: Activate doctest plugin to
find and run doctests in non-test modules.
[NOSE_WITH_DOCTEST]
--doctest-tests Also look for doctests in test modules. Note that
classes, methods and functions should have either
doctests or non-doctest tests, not both.
[NOSE_DOCTEST_TESTS]
--doctest-extension=EXT
Also look for doctests in files with this extension
[NOSE_DOCTEST_EXTENSION]
--doctest-result-variable=VAR
Change the variable name set to the result of the last
interpreter command from the default '_'. Can be used
to avoid conflicts with the _() function used for text
translation. [NOSE_DOCTEST_RESULT_VAR]
--doctest-fixtures=SUFFIX
Find fixtures for a doctest file in module with this
name appended to the base name of the doctest file
--with-isolation Enable plugin IsolationPlugin: Activate the isolation
plugin to isolate changes to external modules to a
single test module or package. The isolation plugin
resets the contents of sys.modules after each test
module or package runs to its state before the test.
PLEASE NOTE that this plugin should not be used with
the coverage plugin, or in any other case where module
reloading may produce undesirable side-effects.
[NOSE_WITH_ISOLATION]
-d, --detailed-errors, --failure-detail
Add detail to error output by attempting to evaluate
failed asserts [NOSE_DETAILED_ERRORS]
--with-profile Enable plugin Profile: Use this plugin to run tests
using the hotshot profiler. [NOSE_WITH_PROFILE]
--profile-sort=SORT Set sort order for profiler output
--profile-stats-file=FILE
Profiler stats file; default is a new temp file on
each run
--profile-restrict=RESTRICT
Restrict profiler output. See help for pstats.Stats
for details
--no-skip Disable special handling of SkipTest exceptions.
--with-id Enable plugin TestId: Activate to add a test id (like
#1) to each test name output. Activate with --failed
to rerun failing tests only. [NOSE_WITH_ID]
--id-file=FILE Store test ids found in test runs in this file.
Default is the file .noseids in the working directory.
--failed Run the tests that failed in the last test run.
--processes=NUM Spread test run among this many processes. Set a
number equal to the number of processors or cores in
your machine for best results. [NOSE_PROCESSES]
--process-timeout=SECONDS
Set timeout for return of results from each test
runner process. [NOSE_PROCESS_TIMEOUT]
--with-xunit Enable plugin Xunit: This plugin provides test results
in the standard XUnit XML format. [NOSE_WITH_XUNIT]
--xunit-file=FILE Path to xml file to store the xunit report in. Default
is nosetests.xml in the working directory
[NOSE_XUNIT_FILE]
--all-modules Enable plugin AllModules: Collect tests from all
python modules. [NOSE_ALL_MODULES]
--collect-only Enable collect-only: Collect and output test names
only, don't run any tests. [COLLECT_ONLY]
--with-nosexunit Enable plugin NoseXUnit: Output XML report of test
status [NOSE_WITH_NOSEXUNIT]
--core-target=CORE_TARGET
Output folder for test reports (default is
target\NoseXUnit\core).
--source-folder=SOURCE
Set source folder (optional for core functionality,
required for audit and coverage). Add folder in
sys.path.
--search-source Walk in the source folder to add deeper folders in
sys.path if they don't contain __init__.py file. Works
only if --source-folder is defined.
--search-test Search tests in folders with no __init__.py file
(default: do nothing).
--extra-include=EXTRA_INCLUDE
Include packages for audit or coverage processing
(default: take all packages in --source-folder, except
those defined in --extra-exclude).
--extra-exclude=EXTRA_EXCLUDE
Exclude packages for audit or coverage processing
(default: ez_setup, setup). Useless if --extra-include
defined.
--extra-test-process Include packages matching the test pattern in audit or
coverage processing (default: no).
--enable-audit Use PyLint to audit source code (default: no)
--audit-target=AUDIT_TARGET
Output folder for PyLint reports (default is
target\NoseXUnit\audit).
--audit-output=AUDIT_OUTPUT
Output for audit reports: nosexunit, parseable, text,
colorized, html, msvs (default: nosexunit).
--audit-config=AUDIT_CONFIG
Configuration file for PyLint (optional).
--enable-cover Use coverage to audit source code (default: no)
--cover-target=COVER_TARGET
Output folder for coverage reports (default is
target\NoseXUnit\cover).
--cover-clean Clean previous coverage results (default: no).
--cover-collect Collect other coverage files potentially generated in
cover target folder. These extra files should have the
following pattern: .coverage.* (default: no).
参数一个一个的学习吧,
完成了将noetests输出的xml转换成excel输出。
代码覆盖率的一个以xml格式输出的插件:nose-xcover
https://github.com/cmheisel/nose-xcover
下载完成后解压:python setup.py install
nosetests -s --with-xcoverage --with-xunit
Usage: nosetests-script.py [options]
Options:
-h, --help show this help message and exit
-V, --version Output nose version and exit
-p, --plugins Output list of available plugins and exit. Combine
with higher verbosity for greater detail
-v, --verbose Be more verbose. [NOSE_VERBOSE]
--verbosity=VERBOSITY
Set verbosity; --verbosity=2 is the same as -v
-q, --quiet Be less verbose
-c FILES, --config=FILES
Load configuration from config file(s). May be
specified multiple times; in that case, all config
files will be loaded and combined
-w WHERE, --where=WHERE
Look for tests in this directory. May be specified
multiple times. The first directory passed will be
used as the working directory, in place of the current
working directory, which is the default. Others will
be added to the list of tests to execute. [NOSE_WHERE]
--py3where=PY3WHERE Look for tests in this directory under Python 3.x.
Functions the same as 'where', but only applies if
running under Python 3.x or above. Note that, if
present under 3.x, this option completely replaces any
directories specified with 'where', so the 'where'
option becomes ineffective. [NOSE_PY3WHERE]
-m REGEX, --match=REGEX, --testmatch=REGEX
Files, directories, function names, and class names
that match this regular expression are considered
tests. Default: (?:^|[\b_\.\-])[Tt]est
[NOSE_TESTMATCH]
--tests=NAMES Run these tests (comma-separated list). This argument
is useful mainly from configuration files; on the
command line, just pass the tests to run as additional
arguments with no switch.
-l DEBUG, --debug=DEBUG
Activate debug logging for one or more systems.
Available debug loggers: nose, nose.importer,
nose.inspector, nose.plugins, nose.result and
nose.selector. Separate multiple names with a comma.
--debug-log=FILE Log debug messages to this file (default: sys.stderr)
--logging-config=FILE, --log-config=FILE
Load logging config from this file -- bypasses all
other logging config settings.
-e REGEX, --exclude=REGEX
Don't run tests that match regular expression
[NOSE_EXCLUDE]
-i REGEX, --include=REGEX
This regular expression will be applied to files,
directories, function names, and class names for a
chance to include additional tests that do not match
TESTMATCH. Specify this option multiple times to add
more regular expressions [NOSE_INCLUDE]
-x, --stop Stop running tests after the first error or failure
-P, --no-path-adjustment
Don't make any changes to sys.path when loading tests
[NOSE_NOPATH]
--exe Look for tests in python modules that are executable.
Normal behavior. is to exclude executable modules,
since they may not be import-safe [NOSE_INCLUDE_EXE]
--noexe DO NOT look for tests in python modules that are
executable. (The default on the windows platform. is to
do so.)
--traverse-namespace Traverse through all path entries of a namespace
package
--first-package-wins=FIRSTPACKAGEWINS, --first-pkg-wins=FIRSTPACKAGEWINS, --1st-pkg-wins=FIRSTPACKAGEWINS
nose's importer will normally evict a package from
sys.modules if it sees a package with the same name in
a different location. Set this option to disable that
behavior.
-a ATTR, --attr=ATTR Run only tests that have attributes specified by ATTR
[NOSE_ATTR]
-A EXPR, --eval-attr=EXPR
Run only tests for whose attributes the Python
expression EXPR evaluates to True [NOSE_EVAL_ATTR]
-s, --nocapture Don't capture stdout (any stdout output will be
printed immediately) [NOSE_NOCAPTURE]
-s, 不捕获输出,会让你的程序里面的一些命令行上的输出显示出来。例如print所输出的内容。
--nologcapture Disable logging capture plugin. Logging configurtion
will be left intact. [NOSE_NOLOGCAPTURE]
--logging-format=FORMAT
Specify custom format to print statements. Uses the
same format as used by standard logging handlers.
[NOSE_LOGFORMAT]
--logging-datefmt=FORMAT
Specify custom date/time format to print statements.
Uses the same format as used by standard logging
handlers. [NOSE_LOGDATEFMT]
--logging-filter=FILTER
Specify which statements to filter in/out. By default,
everything is captured. If the output is too verbose,
use this option to filter out needless output.
Example: filter=foo will capture statements issued
ONLY to foo or foo.what.ever.sub but not foobar or
other logger. Specify multiple loggers with comma:
filter=foo,bar,baz. If any logger name is prefixed
with a minus, eg filter=-foo, it will be excluded
rather than included. Default: exclude logging
messages from nose itself (-nose). [NOSE_LOGFILTER]
--logging-clear-handlers
Clear all other logging handlers
--with-coverage Enable plugin Coverage: Activate a coverage report
using Ned Batchelder's coverage module.
[NOSE_WITH_COVERAGE]
--cover-package=PACKAGE
Restrict coverage output to selected packages
[NOSE_COVER_PACKAGE]
--cover-erase Erase previously collected coverage statistics before
run
--cover-tests Include test modules in coverage report
[NOSE_COVER_TESTS]
--cover-inclusive Include all python files under working directory in
coverage report. Useful for discovering holes in test
coverage if not all files are imported by the test
suite. [NOSE_COVER_INCLUSIVE]
--cover-html Produce HTML coverage information
--cover-html-dir=DIR Produce HTML coverage information in dir
--pdb Drop into debugger on errors
--pdb-failures Drop into debugger on failures
--no-deprecated Disable special handling of DeprecatedTest exceptions.
--with-doctest Enable plugin Doctest: Activate doctest plugin to
find and run doctests in non-test modules.
[NOSE_WITH_DOCTEST]
--doctest-tests Also look for doctests in test modules. Note that
classes, methods and functions should have either
doctests or non-doctest tests, not both.
[NOSE_DOCTEST_TESTS]
--doctest-extension=EXT
Also look for doctests in files with this extension
[NOSE_DOCTEST_EXTENSION]
--doctest-result-variable=VAR
Change the variable name set to the result of the last
interpreter command from the default '_'. Can be used
to avoid conflicts with the _() function used for text
translation. [NOSE_DOCTEST_RESULT_VAR]
--doctest-fixtures=SUFFIX
Find fixtures for a doctest file in module with this
name appended to the base name of the doctest file
--with-isolation Enable plugin IsolationPlugin: Activate the isolation
plugin to isolate changes to external modules to a
single test module or package. The isolation plugin
resets the contents of sys.modules after each test
module or package runs to its state before the test.
PLEASE NOTE that this plugin should not be used with
the coverage plugin, or in any other case where module
reloading may produce undesirable side-effects.
[NOSE_WITH_ISOLATION]
-d, --detailed-errors, --failure-detail
Add detail to error output by attempting to evaluate
failed asserts [NOSE_DETAILED_ERRORS]
--with-profile Enable plugin Profile: Use this plugin to run tests
using the hotshot profiler. [NOSE_WITH_PROFILE]
--profile-sort=SORT Set sort order for profiler output
--profile-stats-file=FILE
Profiler stats file; default is a new temp file on
each run
--profile-restrict=RESTRICT
Restrict profiler output. See help for pstats.Stats
for details
--no-skip Disable special handling of SkipTest exceptions.
--with-id Enable plugin TestId: Activate to add a test id (like
#1) to each test name output. Activate with --failed
to rerun failing tests only. [NOSE_WITH_ID]
--id-file=FILE Store test ids found in test runs in this file.
Default is the file .noseids in the working directory.
--failed Run the tests that failed in the last test run.
--processes=NUM Spread test run among this many processes. Set a
number equal to the number of processors or cores in
your machine for best results. [NOSE_PROCESSES]
--process-timeout=SECONDS
Set timeout for return of results from each test
runner process. [NOSE_PROCESS_TIMEOUT]
--with-xunit Enable plugin Xunit: This plugin provides test results
in the standard XUnit XML format. [NOSE_WITH_XUNIT]
--xunit-file=FILE Path to xml file to store the xunit report in. Default
is nosetests.xml in the working directory
[NOSE_XUNIT_FILE]
--all-modules Enable plugin AllModules: Collect tests from all
python modules. [NOSE_ALL_MODULES]
--collect-only Enable collect-only: Collect and output test names
only, don't run any tests. [COLLECT_ONLY]
--with-nosexunit Enable plugin NoseXUnit: Output XML report of test
status [NOSE_WITH_NOSEXUNIT]
--core-target=CORE_TARGET
Output folder for test reports (default is
target\NoseXUnit\core).
--source-folder=SOURCE
Set source folder (optional for core functionality,
required for audit and coverage). Add folder in
sys.path.
--search-source Walk in the source folder to add deeper folders in
sys.path if they don't contain __init__.py file. Works
only if --source-folder is defined.
--search-test Search tests in folders with no __init__.py file
(default: do nothing).
--extra-include=EXTRA_INCLUDE
Include packages for audit or coverage processing
(default: take all packages in --source-folder, except
those defined in --extra-exclude).
--extra-exclude=EXTRA_EXCLUDE
Exclude packages for audit or coverage processing
(default: ez_setup, setup). Useless if --extra-include
defined.
--extra-test-process Include packages matching the test pattern in audit or
coverage processing (default: no).
--enable-audit Use PyLint to audit source code (default: no)
--audit-target=AUDIT_TARGET
Output folder for PyLint reports (default is
target\NoseXUnit\audit).
--audit-output=AUDIT_OUTPUT
Output for audit reports: nosexunit, parseable, text,
colorized, html, msvs (default: nosexunit).
--audit-config=AUDIT_CONFIG
Configuration file for PyLint (optional).
--enable-cover Use coverage to audit source code (default: no)
--cover-target=COVER_TARGET
Output folder for coverage reports (default is
target\NoseXUnit\cover).
--cover-clean Clean previous coverage results (default: no).
--cover-collect Collect other coverage files potentially generated in
cover target folder. These extra files should have the
following pattern: .coverage.* (default: no).
参数一个一个的学习吧,
完成了将noetests输出的xml转换成excel输出。
代码覆盖率的一个以xml格式输出的插件:nose-xcover
https://github.com/cmheisel/nose-xcover
下载完成后解压:python setup.py install
nosetests -s --with-xcoverage --with-xunit
TAG:
标题搜索
日历
|
|||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
1 | 2 | 3 | 4 | ||||||
5 | 6 | 7 | 8 | 9 | 10 | 11 | |||
12 | 13 | 14 | 15 | 16 | 17 | 18 | |||
19 | 20 | 21 | 22 | 23 | 24 | 25 | |||
26 | 27 | 28 | 29 | 30 | 31 |
我的存档
数据统计
- 访问量: 118425
- 日志数: 72
- 建立时间: 2010-09-08
- 更新时间: 2013-04-16