Source

nose3 / nosetests.1

.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.36.
.TH NOSETESTS "1" "July 2007" "nosetests version 0.10.0a1" "User Commands"
.SH NAME
nosetests \- unit testing for Python software
.SH SYNOPSIS
\fBnosetests\fP [\fIoptions\fP] [\fInames\fP]
.SH DESCRIPTION
nose provides extended test discovery and running features for
unittest.

nose collects tests automatically from python source files,
directories and packages found in its working directory (which
defaults to the current working directory). Any python source file,
directory or package that matches the testMatch regular expression
(by default: (?:^|[\eb_\e.\-])[Tt]est) will be collected as a test (or
source for collection of tests). In addition, all other packages
found in the working directory will be examined for python source files
or directories that match testMatch. Package discovery descends all
the way down the tree, so package.tests and package.sub.tests and
package.sub.sub2.tests will all be collected.

Within a test directory or package, any python source file matching
testMatch will be examined for test cases. Within a test module,
functions and classes whose names match testMatch and TestCase
subclasses with any name will be loaded and executed as tests. Tests
may use the assert keyword or raise AssertionErrors to indicate test
failure. TestCase subclasses may do the same or use the various
TestCase methods available.

.B Selecting Tests

To specify which tests to run, pass test names on the command line:

nosetests only_test_this.py

Test names specified may be file or module names, and may optionally
indicate the test case to run by separating the module or file name
from the test case name with a colon. Filenames may be relative or
absolute. Examples:

  nosetests test.module
  nosetests another.test:TestCase.test_method
  nosetests a.test:TestCase
  nosetests /path/to/test/file.py:test_function

You may also change the working directory where nose looks for tests,
use the \fB\-w\fR switch:

nosetests \fB\-w\fR /path/to/tests


Note however that support for multiple \fB\-w\fR arguments is deprecated
in this version and will be removed in a future release, since as
of nose 0.10 you can get the same behavior by specifying the
target directories *without* the \fB\-w\fR switch:

nosetests /path/to/tests /another/path/to/tests

Further customization of test selection and loading is possible
through the use of plugins.

Test result output is identical to that of unittest, except for
the additional features (error classes, and plugin\-supplied
features such as output capture and assert introspection) detailed
in the options below.

.B Configuration

In addition to passing command\-line options, you may also put configuration
options in a .noserc or nose.cfg file in your home directory. These are
standard .ini\-style config files. Put your nosetests configuration in a
[nosetests] section, with the \fB\-\-\fR prefix removed:

  [nosetests]
  verbosity=3
  with\-doctest=1

All configuration files that are found will be loaded and their options
combined.
.SS "options:"
.TP
\fB\-h\fR, \fB\-\-help\fR
show this help message and exit
.TP
\fB\-V\fR, \fB\-\-version\fR
Output nose version and exit
.TP
\fB\-p\fR, \fB\-\-plugins\fR
Output list of available plugins and exit. Combine
with higher verbosity for greater detail
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Be more verbose. [NOSE_VERBOSE]
.TP
\fB\-\-verbosity\fR=\fIVERBOSITY\fR
Set verbosity; \fB\-\-verbosity\fR=\fI2\fR is the same as \fB\-v\fR
.HP
\fB\-q\fR, \fB\-\-quiet\fR
.TP
\fB\-c\fR FILES, \fB\-\-config\fR=\fIFILES\fR
Load configuration from config file(s). May be
specified multiple times; in that case, all config
files will be loaded and combined
.TP
\fB\-w\fR WHERE, \fB\-\-where\fR=\fIWHERE\fR
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]
.TP
\fB\-m\fR TESTMATCH, \fB\-\-match\fR=\fITESTMATCH\fR, \fB\-\-testmatch\fR=\fITESTMATCH\fR
Use this regular expression to find tests
[NOSE_TESTMATCH]
.TP
\fB\-\-tests\fR=\fITESTNAMES\fR
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.
.TP
\fB\-l\fR DEBUG, \fB\-\-debug\fR=\fIDEBUG\fR
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.
.TP
\fB\-\-debug\-log\fR=\fIDEBUGLOG\fR
Log debug messages to this file (default: sys.stderr)
.TP
\fB\-\-logging\-config\fR=\fILOGGINGCONFIG\fR, \fB\-\-log\-config\fR=\fILOGGINGCONFIG\fR
Load logging config from this file \fB\-\-\fR bypasses all
other logging config settings.
.TP
\fB\-e\fR EXCLUDE, \fB\-\-exclude\fR=\fIEXCLUDE\fR
Don't run tests that match regular expression
[NOSE_EXCLUDE]
.TP
\fB\-i\fR INCLUDE, \fB\-\-include\fR=\fIINCLUDE\fR
Also run tests that match regular expression
[NOSE_INCLUDE]
.TP
\fB\-x\fR, \fB\-\-stop\fR
Stop running tests after the first error or failure
.TP
\fB\-P\fR, \fB\-\-no\-path\-adjustment\fR
Don't make any changes to sys.path when loading tests
[NOSE_NOPATH]
.TP
\fB\-\-exe\fR
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]
.TP
\fB\-\-noexe\fR
DO NOT look for tests in python modules that are
executable. (The default on the windows platform is to
do so.)
.TP
\fB\-\-with\-html\-output\fR
Enable plugin HtmlOutput: Output test results as ugly,
unstyled html.      [NOSE_WITH_HTML\-OUTPUT]
.TP
\fB\-\-with\-watch\fR
Enable plugin NoseWatch: watch failing tests, retesting when modified      [NOSE_WITH_WATCH]
.TP
\fB\-\-with\-stopwatch\fR
Enable plugin Stopwatch: (no help available)
[NOSE_WITH_STOPWATCH]
.TP
\fB\-\-faster\-than\fR=\fIFASTER_THAN\fR
Run only tests that are faster than FASTER_THAN
seconds.
.TP
\fB\-\-stopwatch\-file\fR=\fISTOPWATCH_FILE\fR
Store test timing results in this file.
.TP
\fB\-\-with\-figleafsections\fR
Enable plugin FigleafSections: (no help available)
[NOSE_WITH_FIGLEAFSECTIONS]
.TP
\fB\-\-figleaf\-file\fR=\fIFIGLEAF_FILE\fR
Store figleaf section coverage in this file
.TP
\fB\-\-decorator\-file\fR=\fIDECORATOR_FILE\fR
Apply attributes in this file to matching functions,
classes, and methods
.TP
\fB\-\-with\-tty\fR
Enable plugin NoseTTY: run nosetests more
interactively [NOSE_WITH_TTY]
.TP
\fB\-\-tty\fR
Enable plugin NoseTTY: run nosetests more
interactively [NOSE_TTY]
.TP
\fB\-\-tty\-editor\fR=\fINOSE_TTY_EDITOR\fR
editor program [NOSE_TTY_EDITOR or EDITOR] (currently:
`None`)
.TP
\fB\-\-tty\-edit\-cmd\fR=\fINOSE_TTY_EDIT_CMD\fR
template to invoke edit command.  [NOSE_TTY_EDIT_CMD]
(currently: `%(editor)s %(filename)s \fB\-\-line\fR
%(lineno)s`)
.TP
\fB\-a\fR ATTR, \fB\-\-attr\fR=\fIATTR\fR
Run only tests that have attributes specified by ATTR
[NOSE_ATTR]
.TP
\fB\-A\fR EXPR, \fB\-\-eval\-attr\fR=\fIEXPR\fR
Run only tests for whose attributes the Python
expression EXPR evaluates to True [NOSE_EVAL_ATTR]
.TP
\fB\-s\fR, \fB\-\-nocapture\fR
Don't capture stdout (any stdout output will be
printed immediately) [NOSE_NOCAPTURE]
.TP
\fB\-\-with\-coverage\fR
Enable plugin Coverage:  If you have Ned Batchelder's
coverage module installed, you may activate a coverage
report. The coverage report will cover any python
source module imported after the start of the test
run, excluding modules that match testMatch. If you
want to include those modules too, use the \fB\-\-covertests\fR switch, or set the NOSE_COVER_TESTS environment
variable to a true value. To restrict the coverage
report to modules from a particular package or
packages, use the \fB\-\-cover\-packages\fR switch or the
NOSE_COVER_PACKAGES environment variable.
[NOSE_WITH_COVERAGE]
.TP
\fB\-\-cover\-package\fR=\fICOVER_PACKAGES\fR
Restrict coverage output to selected packages
[NOSE_COVER_PACKAGE]
.TP
\fB\-\-cover\-erase\fR
Erase previously collected coverage statistics before
run
.TP
\fB\-\-cover\-tests\fR
Include test modules in coverage report
[NOSE_COVER_TESTS]
.TP
\fB\-\-cover\-inclusive\fR
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]
.TP
\fB\-\-pdb\fR
Drop into debugger on errors
.TP
\fB\-\-pdb\-failures\fR
Drop into debugger on failures
.TP
\fB\-\-no\-deprecated\fR
Disable special handling of DeprecatedTest exceptions.
.TP
\fB\-\-with\-doctest\fR
Enable plugin Doctest:  Activate doctest plugin to
find and run doctests in non\-test modules.
[NOSE_WITH_DOCTEST]
.TP
\fB\-\-doctest\-tests\fR
Also look for doctests in test modules
[NOSE_DOCTEST_TESTS]
.TP
\fB\-\-doctest\-extension\fR=\fIDOCTESTEXTENSION\fR
Also look for doctests in files with this extension
[NOSE_DOCTEST_EXTENSION]
.TP
\fB\-\-with\-isolation\fR
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 in any other case where module
reloading may produce undesirable side\-effects.
[NOSE_WITH_ISOLATION]
.TP
\fB\-d\fR, \fB\-\-detailed\-errors\fR, \fB\-\-failure\-detail\fR
Add detail to error output by attempting to evaluate
failed asserts [NOSE_DETAILED_ERRORS]
.TP
\fB\-\-with\-profile\fR
Enable plugin Profile:  Use this plugin to run tests
using the hotshot profiler.   [NOSE_WITH_PROFILE]
.TP
\fB\-\-profile\-sort\fR=\fIPROFILE_SORT\fR
Set sort order for profiler output
.TP
\fB\-\-profile\-stats\-file\fR=\fIPROFILE_STATS_FILE\fR
Profiler stats file; default is a new temp file on
each run
.TP
\fB\-\-profile\-restrict\fR=\fIPROFILE_RESTRICT\fR
Restrict profiler output. See help for pstats.Stats
for details
.TP
\fB\-\-no\-skip\fR
Disable special handling of SkipTest exceptions.
.TP
\fB\-\-with\-id\fR
Enable plugin TestId:  Activate to add a test id (like
#1) to each test name output. After you've run once to
generate test ids, you can re\-run individual tests by
activating the plugin and passing the ids (with or
without the # prefix) instead of test names.
[NOSE_WITH_ID]
.TP
\fB\-\-id\-file\fR=\fITESTIDFILE\fR
Store test ids found in test runs in this file.
.SH AUTHOR
.B nose
is written by Jason Pellerin. This manpage was adapted from the output
of the
.B help2man(1)
program by Jason Pellerin, following the version made by Gustavo Noronha Silva for the Debian GNU/Linux system, but
may be used by others.
.SH COPYRIGHT
Copyright (C) 2005-2007 Jason Pellerin

This is free software.  You may redistribute copies of it under the
terms of the GNU Lesser General Public License
<http://www.gnu.org/licenses/lgpl.html>.  There is NO WARRANTY, to the
extent permitted by law.
.SH SEE ALSO
The project website is at
.B http://somethingaboutorange.com/mrl/projects/nose/
.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.