root/galaxy-central/eggs/nose-0.11.1-py2.6.egg/man/man1/nosetests.1 @ 3

リビジョン 3, 13.1 KB (コミッタ: kohda, 14 年 前)

Install Unix tools  http://hannonlab.cshl.edu/galaxy_unix_tools/galaxy.html

行番号 
1.TH nosetests 1 "2009-04-23" "0.11" "User Commands"
2.SH NAME
3nosetests \- nicer testing for python
4.\" Man page generated from reStructeredText.
5.INDENT 0.0
6.UNINDENT
7
8.SH SYNOPSIS
9.INDENT 0.0
10.INDENT 3.5
11nosetests [options] [names]
12
13.UNINDENT
14.UNINDENT
15
16.SH DESCRIPTION
17nose collects tests automatically from python source files,
18directories and packages found in its working directory (which
19defaults to the current working directory). Any python source file,
20directory or package that matches the testMatch regular expression
21(by default: \fI(?:^|[b_.\-])[Tt]est)\fP will be collected as a test (or
22source for collection of tests). In addition, all other packages
23found in the working directory will be examined for python source files
24or directories that match testMatch. Package discovery descends all
25the way down the tree, so package.tests and package.sub.tests and
26package.sub.sub2.tests will all be collected.
27
28Within a test directory or package, any python source file matching
29testMatch will be examined for test cases. Within a test module,
30functions and classes whose names match testMatch and TestCase
31subclasses with any name will be loaded and executed as tests. Tests
32may use the assert keyword or raise AssertionErrors to indicate test
33failure. TestCase subclasses may do the same or use the various
34TestCase methods available.
35
36
37.SS Selecting Tests
38To specify which tests to run, pass test names on the command line:
39
40
41.nf
42nosetests only_test_this.py
43.fi
44Test names specified may be file or module names, and may optionally
45indicate the test case to run by separating the module or file name
46from the test case name with a colon. Filenames may be relative or
47absolute. Examples:
48
49
50.nf
51nosetests test.module
52nosetests another.test:TestCase.test_method
53nosetests a.test:TestCase
54nosetests /path/to/test/file.py:test_function
55.fi
56You may also change the working directory where nose looks for tests
57by using the \-w switch:
58
59
60.nf
61nosetests \-w /path/to/tests
62.fi
63Note, however, that support for multiple \-w arguments is now deprecated
64and will be removed in a future release. As of nose 0.10, you can get
65the same behavior by specifying the target directories \fIwithout\fP
66the \-w switch:
67
68
69.nf
70nosetests /path/to/tests /another/path/to/tests
71.fi
72Further customization of test selection and loading is possible
73through the use of plugins.
74
75Test result output is identical to that of unittest, except for
76the additional features (error classes, and plugin\-supplied
77features such as output capture and assert introspection) detailed
78in the options below.
79
80
81.SS Configuration
82In addition to passing command\-line options, you may also put
83configuration options in a .noserc or nose.cfg file in your home
84directory. These are standard .ini\-style config files. Put your
85nosetests configuration in a [nosetests] section. Options are the
86same as on the command line, with the \-\- prefix removed. For
87options that are simple switches, you must supply a value:
88
89
90.nf
91[nosetests]
92verbosity=3
93with\-doctest=1
94.fi
95All configuration files that are found will be loaded and their options
96combined.
97
98
99.SS Using Plugins
100There are numerous nose plugins available via easy_install and
101elsewhere. To use a plugin, just install it. The plugin will add
102command line options to nosetests. To verify that the plugin is installed,
103run:
104
105
106.nf
107nosetests \-\-plugins
108.fi
109You can add \-v or \-vv to that command to show more information
110about each plugin.
111
112If you are running nose.main() or nose.run() from a script, you
113can specify a list of plugins to use by passing a list of plugins
114with the plugins keyword argument.
115
116
117.SS 0.9 plugins
118nose 0.11 can use SOME plugins that were written for nose 0.9. The
119default plugin manager inserts a compatibility wrapper around 0.9
120plugins that adapts the changed plugin api calls. However, plugins
121that access nose internals are likely to fail, especially if they
122attempt to access test case or test suite classes. For example,
123plugins that try to determine if a test passed to startTest is an
124individual test or a suite will fail, partly because suites are no
125longer passed to startTest and partly because it\'s likely that the
126plugin is trying to find out if the test is an instance of a class
127that no longer exists.
128
129
130.SS 0.10 plugins
131All plugins written for nose 0.10 should work with nose 0.11.
132
133
134.SS Options
135
136.TP
137\fB\-V\fR\fR\fR, \fB\-\-version\fR\fR
138Output nose version and exit
139
140
141.TP
142\fB\-p\fR\fR\fR, \fB\-\-plugins\fR\fR
143Output list of available plugins and exit. Combine with higher verbosity for greater detail
144
145
146.TP
147\fB\-v\fR\fR=DEFAULT\fR, \fB\-\-verbose\fR\fR=DEFAULT
148Be more verbose. [NOSE_VERBOSE]
149
150
151.TP
152\fB\-\-verbosity\fR\fR=VERBOSITY
153Set verbosity; \-\-verbosity=2 is the same as \-v
154
155
156.TP
157\fB\-q\fR\fR=DEFAULT\fR, \fB\-\-quiet\fR\fR=DEFAULT
158Be less verbose
159
160
161.TP
162\fB\-c\fR\fR=FILES\fR, \fB\-\-config\fR\fR=FILES
163Load configuration from config file(s). May be specified multiple times; in that case, all config files will be loaded and combined
164
165
166.TP
167\fB\-w\fR\fR=WHERE\fR, \fB\-\-where\fR\fR=WHERE
168Look 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]
169
170
171.TP
172\fB\-m\fR\fR=REGEX\fR, \fB\-\-match\fR\fR=REGEX\fR, \fB\-\-testmatch\fR\fR=REGEX
173Files, directories, function names, and class names that match this regular expression are considered tests.  Default: (?:^|[b_./\-])[Tt]est [NOSE_TESTMATCH]
174
175
176.TP
177\fB\-\-tests\fR\fR=NAMES
178Run 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.
179
180
181.TP
182\fB\-l\fR\fR=DEFAULT\fR, \fB\-\-debug\fR\fR=DEFAULT
183Activate 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.
184
185
186.TP
187\fB\-\-debug\-log\fR\fR=FILE
188Log debug messages to this file (default: sys.stderr)
189
190
191.TP
192\fB\-\-logging\-config\fR\fR=FILE\fR, \fB\-\-log\-config\fR\fR=FILE
193Load logging config from this file \-\- bypasses all other logging config settings.
194
195
196.TP
197\fB\-e\fR\fR=REGEX\fR, \fB\-\-exclude\fR\fR=REGEX
198Don\'t run tests that match regular expression [NOSE_EXCLUDE]
199
200
201.TP
202\fB\-i\fR\fR=REGEX\fR, \fB\-\-include\fR\fR=REGEX
203This 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]
204
205
206.TP
207\fB\-x\fR\fR\fR, \fB\-\-stop\fR\fR
208Stop running tests after the first error or failure
209
210
211.TP
212\fB\-P\fR\fR\fR, \fB\-\-no\-path\-adjustment\fR\fR
213Don\'t make any changes to sys.path when loading tests [NOSE_NOPATH]
214
215
216.TP
217\fB\-\-exe\fR\fR
218Look 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]
219
220
221.TP
222\fB\-\-noexe\fR\fR
223DO NOT look for tests in python modules that are executable. (The default on the windows platform is to do so.)
224
225
226.TP
227\fB\-\-traverse\-namespace\fR\fR
228Traverse through all path entries of a namespace package
229
230
231.TP
232\fB\-\-first\-package\-wins\fR\fR=DEFAULT\fR, \fB\-\-first\-pkg\-wins\fR\fR=DEFAULT\fR, \fB\-\-1st\-pkg\-wins\fR\fR=DEFAULT
233nose\'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.
234
235
236.TP
237\fB\-a\fR\fR=ATTR\fR, \fB\-\-attr\fR\fR=ATTR
238Run only tests that have attributes specified by ATTR [NOSE_ATTR]
239
240
241.TP
242\fB\-A\fR\fR=EXPR\fR, \fB\-\-eval\-attr\fR\fR=EXPR
243Run only tests for whose attributes the Python expression EXPR evaluates to True [NOSE_EVAL_ATTR]
244
245
246.TP
247\fB\-s\fR\fR\fR, \fB\-\-nocapture\fR\fR
248Don\'t capture stdout (any stdout output will be printed immediately) [NOSE_NOCAPTURE]
249
250
251.TP
252\fB\-\-nologcapture\fR\fR
253Disable logging capture plugin. Logging configurtion will be left intact. [NOSE_NOLOGCAPTURE]
254
255
256.TP
257\fB\-\-logging\-format\fR\fR=FORMAT
258Specify custom format to print statements. Uses the same format as used by standard logging handlers. [NOSE_LOGFORMAT]
259
260
261.TP
262\fB\-\-logging\-datefmt\fR\fR=FORMAT
263Specify custom date/time format to print statements. Uses the same format as used by standard logging handlers. [NOSE_LOGDATEFMT]
264
265
266.TP
267\fB\-\-logging\-filter\fR\fR=FILTER
268Specify which statements to filter in/out. By default, everything is captured. If the output is too verbose,
269use this option to filter out needless output.
270Example: filter=foo will capture statements issued ONLY to
271 foo or foo.what.ever.sub but not foobar or other logger.
272Specify multiple loggers with comma: filter=foo,bar,baz. [NOSE_LOGFILTER]
273
274
275.TP
276\fB\-\-logging\-clear\-handlers\fR\fR
277Clear all other logging handlers
278
279
280.TP
281\fB\-\-with\-coverage\fR\fR
282Enable plugin Coverage:
283Activate a coverage report using Ned Batchelder\'s coverage module.
284 [NOSE_WITH_COVERAGE]
285
286
287.TP
288\fB\-\-cover\-package\fR\fR=PACKAGE
289Restrict coverage output to selected packages [NOSE_COVER_PACKAGE]
290
291
292.TP
293\fB\-\-cover\-erase\fR\fR
294Erase previously collected coverage statistics before run
295
296
297.TP
298\fB\-\-cover\-tests\fR\fR
299Include test modules in coverage report [NOSE_COVER_TESTS]
300
301
302.TP
303\fB\-\-cover\-inclusive\fR\fR
304Include 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]
305
306
307.TP
308\fB\-\-cover\-html\fR\fR
309Produce HTML coverage information
310
311
312.TP
313\fB\-\-cover\-html\-dir\fR\fR=DIR
314Produce HTML coverage information in dir
315
316
317.TP
318\fB\-\-pdb\fR\fR
319Drop into debugger on errors
320
321
322.TP
323\fB\-\-pdb\-failures\fR\fR
324Drop into debugger on failures
325
326
327.TP
328\fB\-\-no\-deprecated\fR\fR
329Disable special handling of DeprecatedTest exceptions.
330
331
332.TP
333\fB\-\-with\-doctest\fR\fR
334Enable plugin Doctest:
335Activate doctest plugin to find and run doctests in non\-test modules.
336 [NOSE_WITH_DOCTEST]
337
338
339.TP
340\fB\-\-doctest\-tests\fR\fR
341Also 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]
342
343
344.TP
345\fB\-\-doctest\-extension\fR\fR=EXT
346Also look for doctests in files with this extension [NOSE_DOCTEST_EXTENSION]
347
348
349.TP
350\fB\-\-doctest\-result\-variable\fR\fR=VAR
351Change 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]
352
353
354.TP
355\fB\-\-doctest\-fixtures\fR\fR=SUFFIX
356Find fixtures for a doctest file in module with this name appended to the base name of the doctest file
357
358
359.TP
360\fB\-\-with\-isolation\fR\fR
361Enable plugin IsolationPlugin:
362Activate the isolation plugin to isolate changes to external
363modules to a single test module or package. The isolation plugin
364resets the contents of sys.modules after each test module or
365package runs to its state before the test. PLEASE NOTE that this
366plugin should not be used with the coverage plugin, or in any other case
367where module reloading may produce undesirable side\-effects.
368 [NOSE_WITH_ISOLATION]
369
370
371.TP
372\fB\-d\fR\fR\fR, \fB\-\-detailed\-errors\fR\fR\fR, \fB\-\-failure\-detail\fR\fR
373Add detail to error output by attempting to evaluate failed asserts [NOSE_DETAILED_ERRORS]
374
375
376.TP
377\fB\-\-with\-profile\fR\fR
378Enable plugin Profile:
379Use this plugin to run tests using the hotshot profiler.
380 [NOSE_WITH_PROFILE]
381
382
383.TP
384\fB\-\-profile\-sort\fR\fR=SORT
385Set sort order for profiler output
386
387
388.TP
389\fB\-\-profile\-stats\-file\fR\fR=FILE
390Profiler stats file; default is a new temp file on each run
391
392
393.TP
394\fB\-\-profile\-restrict\fR\fR=RESTRICT
395Restrict profiler output. See help for pstats.Stats for details
396
397
398.TP
399\fB\-\-no\-skip\fR\fR
400Disable special handling of SkipTest exceptions.
401
402
403.TP
404\fB\-\-with\-id\fR\fR
405Enable plugin TestId:
406Activate to add a test id (like #1) to each test name output. Activate
407with \-\-failed to rerun failing tests only.
408 [NOSE_WITH_ID]
409
410
411.TP
412\fB\-\-id\-file\fR\fR=FILE
413Store test ids found in test runs in this file. Default is the file .noseids in the working directory.
414
415
416.TP
417\fB\-\-failed\fR\fR
418Run the tests that failed in the last test run.
419
420
421.TP
422\fB\-\-processes\fR\fR=NUM
423Spread 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]
424
425
426.TP
427\fB\-\-process\-timeout\fR\fR=SECONDS
428Set timeout for return of results from each test runner process. [NOSE_PROCESS_TIMEOUT]
429
430
431.TP
432\fB\-\-with\-xunit\fR\fR
433Enable plugin Xunit: This plugin provides test results in the standard XUnit XML format. [NOSE_WITH_XUNIT]
434
435
436.TP
437\fB\-\-xunit\-file\fR\fR=FILE
438Path to xml file to store the xunit report in. Default is nosetests.xml in the working directory [NOSE_XUNIT_FILE]
439
440
441.TP
442\fB\-\-all\-modules\fR\fR
443Enable plugin AllModules: Collect tests from all python modules.
444 [NOSE_ALL_MODULES]
445
446
447.TP
448\fB\-\-collect\-only\fR\fR
449Enable collect\-only:
450Collect and output test names only, don\'t run any tests.
451 [COLLECT_ONLY]
452
453
454.SH AUTHOR
455jpellerin+nose@gmail.com
456
457.SH COPYRIGHT
458LGPL
459
460.\" Generated by docutils manpage writer on 2009-05-13 20:29.
461.\"
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。