root/galaxy-central/eggs/nose-0.11.1-py2.6.egg/nose/usage.txt @ 3

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

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

行番号 
1nose collects tests automatically from python source files,
2directories and packages found in its working directory (which
3defaults to the current working directory). Any python source file,
4directory or package that matches the testMatch regular expression
5(by default: `(?:^|[\b_\.-])[Tt]est)` will be collected as a test (or
6source for collection of tests). In addition, all other packages
7found in the working directory will be examined for python source files
8or directories that match testMatch. Package discovery descends all
9the way down the tree, so package.tests and package.sub.tests and
10package.sub.sub2.tests will all be collected.
11
12Within a test directory or package, any python source file matching
13testMatch will be examined for test cases. Within a test module,
14functions and classes whose names match testMatch and TestCase
15subclasses with any name will be loaded and executed as tests. Tests
16may use the assert keyword or raise AssertionErrors to indicate test
17failure. TestCase subclasses may do the same or use the various
18TestCase methods available.
19
20Selecting Tests
21---------------
22
23To specify which tests to run, pass test names on the command line:
24
25  %prog only_test_this.py
26 
27Test names specified may be file or module names, and may optionally
28indicate the test case to run by separating the module or file name
29from the test case name with a colon. Filenames may be relative or
30absolute. Examples:
31
32  %prog test.module
33  %prog another.test:TestCase.test_method
34  %prog a.test:TestCase
35  %prog /path/to/test/file.py:test_function
36 
37You may also change the working directory where nose looks for tests
38by using the -w switch:
39
40  %prog -w /path/to/tests
41
42Note, however, that support for multiple -w arguments is now deprecated
43and will be removed in a future release. As of nose 0.10, you can get
44the same behavior by specifying the target directories *without*
45the -w switch:
46
47  %prog /path/to/tests /another/path/to/tests
48
49Further customization of test selection and loading is possible
50through the use of plugins.
51
52Test result output is identical to that of unittest, except for
53the additional features (error classes, and plugin-supplied
54features such as output capture and assert introspection) detailed
55in the options below.
56
57Configuration
58-------------
59
60In addition to passing command-line options, you may also put
61configuration options in a .noserc or nose.cfg file in your home
62directory. These are standard .ini-style config files. Put your
63nosetests configuration in a [nosetests] section. Options are the
64same as on the command line, with the -- prefix removed. For
65options that are simple switches, you must supply a value:
66
67  [nosetests]
68  verbosity=3
69  with-doctest=1
70
71All configuration files that are found will be loaded and their options
72combined.
73
74Using Plugins
75-------------
76
77There are numerous nose plugins available via easy_install and
78elsewhere. To use a plugin, just install it. The plugin will add
79command line options to nosetests. To verify that the plugin is installed,
80run:
81
82  nosetests --plugins
83
84You can add -v or -vv to that command to show more information
85about each plugin.
86
87If you are running nose.main() or nose.run() from a script, you
88can specify a list of plugins to use by passing a list of plugins
89with the plugins keyword argument.
90
910.9 plugins
92-----------
93
94nose 0.11 can use SOME plugins that were written for nose 0.9. The
95default plugin manager inserts a compatibility wrapper around 0.9
96plugins that adapts the changed plugin api calls. However, plugins
97that access nose internals are likely to fail, especially if they
98attempt to access test case or test suite classes. For example,
99plugins that try to determine if a test passed to startTest is an
100individual test or a suite will fail, partly because suites are no
101longer passed to startTest and partly because it's likely that the
102plugin is trying to find out if the test is an instance of a class
103that no longer exists.
104
1050.10 plugins
106------------
107
108All plugins written for nose 0.10 should work with nose 0.11.
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。