~ubuntu-branches/debian/squeeze/nose/squeeze

« back to all changes in this revision

Viewing changes to nosetests.1

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Marek, Torsten Marek, Gustavo Noronha Silva
  • Date: 2008-06-12 13:39:43 UTC
  • mfrom: (1.2.1 upstream) (2.1.5 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080612133943-2q7syp67fwl4on13
Tags: 0.10.3-1

[Torsten Marek]
* New upstream release (Closes: #461994)
* debian/control
  - bump standards version to 3.8.0, no changes necessary
  - add suggestions for python-coverage (Closes: #457053)
  - change dependency on python-setuptools into 
    python-pkg-resources (Closes: #468719)
  - added myself to uploaders

[Gustavo Noronha Silva]
* debian/control:
  - remove -1 from build-dep on setuptools

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.36.
 
2
.TH NOSETESTS "1" "July 2007" "nosetests version 0.10.0a1" "User Commands"
 
3
.SH NAME
 
4
nosetests \- unit testing for Python software
 
5
.SH SYNOPSIS
 
6
\fBnosetests\fP [\fIoptions\fP] [\fInames\fP]
 
7
.SH DESCRIPTION
 
8
nose provides extended test discovery and running features for
 
9
unittest.
 
10
 
 
11
nose collects tests automatically from python source files,
 
12
directories and packages found in its working directory (which
 
13
defaults to the current working directory). Any python source file,
 
14
directory or package that matches the testMatch regular expression
 
15
(by default: (?:^|[\eb_\e.\-])[Tt]est) will be collected as a test (or
 
16
source for collection of tests). In addition, all other packages
 
17
found in the working directory will be examined for python source files
 
18
or directories that match testMatch. Package discovery descends all
 
19
the way down the tree, so package.tests and package.sub.tests and
 
20
package.sub.sub2.tests will all be collected.
 
21
 
 
22
Within a test directory or package, any python source file matching
 
23
testMatch will be examined for test cases. Within a test module,
 
24
functions and classes whose names match testMatch and TestCase
 
25
subclasses with any name will be loaded and executed as tests. Tests
 
26
may use the assert keyword or raise AssertionErrors to indicate test
 
27
failure. TestCase subclasses may do the same or use the various
 
28
TestCase methods available.
 
29
 
 
30
.B Selecting Tests
 
31
 
 
32
To specify which tests to run, pass test names on the command line:
 
33
 
 
34
nosetests only_test_this.py
 
35
 
 
36
Test names specified may be file or module names, and may optionally
 
37
indicate the test case to run by separating the module or file name
 
38
from the test case name with a colon. Filenames may be relative or
 
39
absolute. Examples:
 
40
 
 
41
  nosetests test.module
 
42
  nosetests another.test:TestCase.test_method
 
43
  nosetests a.test:TestCase
 
44
  nosetests /path/to/test/file.py:test_function
 
45
 
 
46
You may also change the working directory where nose looks for tests,
 
47
use the \fB\-w\fR switch:
 
48
 
 
49
nosetests \fB\-w\fR /path/to/tests
 
50
 
 
51
 
 
52
Note however that support for multiple \fB\-w\fR arguments is deprecated
 
53
in this version and will be removed in a future release, since as
 
54
of nose 0.10 you can get the same behavior by specifying the
 
55
target directories *without* the \fB\-w\fR switch:
 
56
 
 
57
nosetests /path/to/tests /another/path/to/tests
 
58
 
 
59
Further customization of test selection and loading is possible
 
60
through the use of plugins.
 
61
 
 
62
Test result output is identical to that of unittest, except for
 
63
the additional features (error classes, and plugin\-supplied
 
64
features such as output capture and assert introspection) detailed
 
65
in the options below.
 
66
 
 
67
.B Configuration
 
68
 
 
69
In addition to passing command\-line options, you may also put configuration
 
70
options in a .noserc or nose.cfg file in your home directory. These are
 
71
standard .ini\-style config files. Put your nosetests configuration in a
 
72
[nosetests] section, with the \fB\-\-\fR prefix removed:
 
73
 
 
74
  [nosetests]
 
75
  verbosity=3
 
76
  with\-doctest=1
 
77
 
 
78
All configuration files that are found will be loaded and their options
 
79
combined.
 
80
.SS "options:"
 
81
.TP
 
82
\fB\-h\fR, \fB\-\-help\fR
 
83
show this help message and exit
 
84
.TP
 
85
\fB\-V\fR, \fB\-\-version\fR
 
86
Output nose version and exit
 
87
.TP
 
88
\fB\-p\fR, \fB\-\-plugins\fR
 
89
Output list of available plugins and exit. Combine
 
90
with higher verbosity for greater detail
 
91
.TP
 
92
\fB\-v\fR, \fB\-\-verbose\fR
 
93
Be more verbose. [NOSE_VERBOSE]
 
94
.TP
 
95
\fB\-\-verbosity\fR=\fIVERBOSITY\fR
 
96
Set verbosity; \fB\-\-verbosity\fR=\fI2\fR is the same as \fB\-v\fR
 
97
.HP
 
98
\fB\-q\fR, \fB\-\-quiet\fR
 
99
.TP
 
100
\fB\-c\fR FILES, \fB\-\-config\fR=\fIFILES\fR
 
101
Load configuration from config file(s). May be
 
102
specified multiple times; in that case, all config
 
103
files will be loaded and combined
 
104
.TP
 
105
\fB\-w\fR WHERE, \fB\-\-where\fR=\fIWHERE\fR
 
106
Look for tests in this directory. May be specified
 
107
multiple times. The first directory passed will be
 
108
used as the working directory, in place of the current
 
109
working directory, which is the default. Others will
 
110
be added to the list of tests to execute. [NOSE_WHERE]
 
111
.TP
 
112
\fB\-m\fR TESTMATCH, \fB\-\-match\fR=\fITESTMATCH\fR, \fB\-\-testmatch\fR=\fITESTMATCH\fR
 
113
Use this regular expression to find tests
 
114
[NOSE_TESTMATCH]
 
115
.TP
 
116
\fB\-\-tests\fR=\fITESTNAMES\fR
 
117
Run these tests (comma\-separated list). This argument
 
118
is useful mainly from configuration files; on the
 
119
command line, just pass the tests to run as additional
 
120
arguments with no switch.
 
121
.TP
 
122
\fB\-l\fR DEBUG, \fB\-\-debug\fR=\fIDEBUG\fR
 
123
Activate debug logging for one or more systems.
 
124
Available debug loggers: nose, nose.importer,
 
125
nose.inspector, nose.plugins, nose.result and
 
126
nose.selector. Separate multiple names with a comma.
 
127
.TP
 
128
\fB\-\-debug\-log\fR=\fIDEBUGLOG\fR
 
129
Log debug messages to this file (default: sys.stderr)
 
130
.TP
 
131
\fB\-\-logging\-config\fR=\fILOGGINGCONFIG\fR, \fB\-\-log\-config\fR=\fILOGGINGCONFIG\fR
 
132
Load logging config from this file \fB\-\-\fR bypasses all
 
133
other logging config settings.
 
134
.TP
 
135
\fB\-e\fR EXCLUDE, \fB\-\-exclude\fR=\fIEXCLUDE\fR
 
136
Don't run tests that match regular expression
 
137
[NOSE_EXCLUDE]
 
138
.TP
 
139
\fB\-i\fR INCLUDE, \fB\-\-include\fR=\fIINCLUDE\fR
 
140
Also run tests that match regular expression
 
141
[NOSE_INCLUDE]
 
142
.TP
 
143
\fB\-x\fR, \fB\-\-stop\fR
 
144
Stop running tests after the first error or failure
 
145
.TP
 
146
\fB\-P\fR, \fB\-\-no\-path\-adjustment\fR
 
147
Don't make any changes to sys.path when loading tests
 
148
[NOSE_NOPATH]
 
149
.TP
 
150
\fB\-\-exe\fR
 
151
Look for tests in python modules that are executable.
 
152
Normal behavior is to exclude executable modules,
 
153
since they may not be import\-safe [NOSE_INCLUDE_EXE]
 
154
.TP
 
155
\fB\-\-noexe\fR
 
156
DO NOT look for tests in python modules that are
 
157
executable. (The default on the windows platform is to
 
158
do so.)
 
159
.TP
 
160
\fB\-\-with\-html\-output\fR
 
161
Enable plugin HtmlOutput: Output test results as ugly,
 
162
unstyled html.      [NOSE_WITH_HTML\-OUTPUT]
 
163
.TP
 
164
\fB\-\-with\-watch\fR
 
165
Enable plugin NoseWatch: watch failing tests, retesting when modified      [NOSE_WITH_WATCH]
 
166
.TP
 
167
\fB\-\-with\-stopwatch\fR
 
168
Enable plugin Stopwatch: (no help available)
 
169
[NOSE_WITH_STOPWATCH]
 
170
.TP
 
171
\fB\-\-faster\-than\fR=\fIFASTER_THAN\fR
 
172
Run only tests that are faster than FASTER_THAN
 
173
seconds.
 
174
.TP
 
175
\fB\-\-stopwatch\-file\fR=\fISTOPWATCH_FILE\fR
 
176
Store test timing results in this file.
 
177
.TP
 
178
\fB\-\-with\-figleafsections\fR
 
179
Enable plugin FigleafSections: (no help available)
 
180
[NOSE_WITH_FIGLEAFSECTIONS]
 
181
.TP
 
182
\fB\-\-figleaf\-file\fR=\fIFIGLEAF_FILE\fR
 
183
Store figleaf section coverage in this file
 
184
.TP
 
185
\fB\-\-decorator\-file\fR=\fIDECORATOR_FILE\fR
 
186
Apply attributes in this file to matching functions,
 
187
classes, and methods
 
188
.TP
 
189
\fB\-\-with\-tty\fR
 
190
Enable plugin NoseTTY: run nosetests more
 
191
interactively [NOSE_WITH_TTY]
 
192
.TP
 
193
\fB\-\-tty\fR
 
194
Enable plugin NoseTTY: run nosetests more
 
195
interactively [NOSE_TTY]
 
196
.TP
 
197
\fB\-\-tty\-editor\fR=\fINOSE_TTY_EDITOR\fR
 
198
editor program [NOSE_TTY_EDITOR or EDITOR] (currently:
 
199
`None`)
 
200
.TP
 
201
\fB\-\-tty\-edit\-cmd\fR=\fINOSE_TTY_EDIT_CMD\fR
 
202
template to invoke edit command.  [NOSE_TTY_EDIT_CMD]
 
203
(currently: `%(editor)s %(filename)s \fB\-\-line\fR
 
204
%(lineno)s`)
 
205
.TP
 
206
\fB\-a\fR ATTR, \fB\-\-attr\fR=\fIATTR\fR
 
207
Run only tests that have attributes specified by ATTR
 
208
[NOSE_ATTR]
 
209
.TP
 
210
\fB\-A\fR EXPR, \fB\-\-eval\-attr\fR=\fIEXPR\fR
 
211
Run only tests for whose attributes the Python
 
212
expression EXPR evaluates to True [NOSE_EVAL_ATTR]
 
213
.TP
 
214
\fB\-s\fR, \fB\-\-nocapture\fR
 
215
Don't capture stdout (any stdout output will be
 
216
printed immediately) [NOSE_NOCAPTURE]
 
217
.TP
 
218
\fB\-\-with\-coverage\fR
 
219
Enable plugin Coverage:  If you have Ned Batchelder's
 
220
coverage module installed, you may activate a coverage
 
221
report. The coverage report will cover any python
 
222
source module imported after the start of the test
 
223
run, excluding modules that match testMatch. If you
 
224
want to include those modules too, use the \fB\-\-covertests\fR switch, or set the NOSE_COVER_TESTS environment
 
225
variable to a true value. To restrict the coverage
 
226
report to modules from a particular package or
 
227
packages, use the \fB\-\-cover\-packages\fR switch or the
 
228
NOSE_COVER_PACKAGES environment variable.
 
229
[NOSE_WITH_COVERAGE]
 
230
.TP
 
231
\fB\-\-cover\-package\fR=\fICOVER_PACKAGES\fR
 
232
Restrict coverage output to selected packages
 
233
[NOSE_COVER_PACKAGE]
 
234
.TP
 
235
\fB\-\-cover\-erase\fR
 
236
Erase previously collected coverage statistics before
 
237
run
 
238
.TP
 
239
\fB\-\-cover\-tests\fR
 
240
Include test modules in coverage report
 
241
[NOSE_COVER_TESTS]
 
242
.TP
 
243
\fB\-\-cover\-inclusive\fR
 
244
Include all python files under working directory in
 
245
coverage report.  Useful for discovering holes in test
 
246
coverage if not all files are imported by the test
 
247
suite. [NOSE_COVER_INCLUSIVE]
 
248
.TP
 
249
\fB\-\-pdb\fR
 
250
Drop into debugger on errors
 
251
.TP
 
252
\fB\-\-pdb\-failures\fR
 
253
Drop into debugger on failures
 
254
.TP
 
255
\fB\-\-no\-deprecated\fR
 
256
Disable special handling of DeprecatedTest exceptions.
 
257
.TP
 
258
\fB\-\-with\-doctest\fR
 
259
Enable plugin Doctest:  Activate doctest plugin to
 
260
find and run doctests in non\-test modules.
 
261
[NOSE_WITH_DOCTEST]
 
262
.TP
 
263
\fB\-\-doctest\-tests\fR
 
264
Also look for doctests in test modules
 
265
[NOSE_DOCTEST_TESTS]
 
266
.TP
 
267
\fB\-\-doctest\-extension\fR=\fIDOCTESTEXTENSION\fR
 
268
Also look for doctests in files with this extension
 
269
[NOSE_DOCTEST_EXTENSION]
 
270
.TP
 
271
\fB\-\-with\-isolation\fR
 
272
Enable plugin IsolationPlugin:  Activate the isolation
 
273
plugin to isolate changes to external modules to a
 
274
single test module or package. The isolation plugin
 
275
resets the contents of sys.modules after each test
 
276
module or package runs to its state before the test.
 
277
PLEASE NOTE that this plugin should not be used with
 
278
the coverage plugin in any other case where module
 
279
reloading may produce undesirable side\-effects.
 
280
[NOSE_WITH_ISOLATION]
 
281
.TP
 
282
\fB\-d\fR, \fB\-\-detailed\-errors\fR, \fB\-\-failure\-detail\fR
 
283
Add detail to error output by attempting to evaluate
 
284
failed asserts [NOSE_DETAILED_ERRORS]
 
285
.TP
 
286
\fB\-\-with\-profile\fR
 
287
Enable plugin Profile:  Use this plugin to run tests
 
288
using the hotshot profiler.   [NOSE_WITH_PROFILE]
 
289
.TP
 
290
\fB\-\-profile\-sort\fR=\fIPROFILE_SORT\fR
 
291
Set sort order for profiler output
 
292
.TP
 
293
\fB\-\-profile\-stats\-file\fR=\fIPROFILE_STATS_FILE\fR
 
294
Profiler stats file; default is a new temp file on
 
295
each run
 
296
.TP
 
297
\fB\-\-profile\-restrict\fR=\fIPROFILE_RESTRICT\fR
 
298
Restrict profiler output. See help for pstats.Stats
 
299
for details
 
300
.TP
 
301
\fB\-\-no\-skip\fR
 
302
Disable special handling of SkipTest exceptions.
 
303
.TP
 
304
\fB\-\-with\-id\fR
 
305
Enable plugin TestId:  Activate to add a test id (like
 
306
#1) to each test name output. After you've run once to
 
307
generate test ids, you can re\-run individual tests by
 
308
activating the plugin and passing the ids (with or
 
309
without the # prefix) instead of test names.
 
310
[NOSE_WITH_ID]
 
311
.TP
 
312
\fB\-\-id\-file\fR=\fITESTIDFILE\fR
 
313
Store test ids found in test runs in this file.
 
314
.SH AUTHOR
 
315
.B nose
 
316
is written by Jason Pellerin. This manpage was adapted from the output
 
317
of the
 
318
.B help2man(1)
 
319
program by Jason Pellerin, following the version made by Gustavo Noronha Silva for the Debian GNU/Linux system, but
 
320
may be used by others.
 
321
.SH COPYRIGHT
 
322
Copyright (C) 2005-2007 Jason Pellerin
 
323
 
 
324
This is free software.  You may redistribute copies of it under the
 
325
terms of the GNU Lesser General Public License
 
326
<http://www.gnu.org/licenses/lgpl.html>.  There is NO WARRANTY, to the
 
327
extent permitted by law.
 
328
.SH SEE ALSO
 
329
The project website is at
 
330
.B http://somethingaboutorange.com/mrl/projects/nose/
 
331
.