Note to Users — nose 1.3.7 documentation (original) (raw)
is nicer testing for python
nose extends unittest to make testing easier.
Note to Users¶
Nose has been in maintenance mode for the past several years and will likely cease without a new person/team to take over maintainership. New projects should consider using Nose2, py.test, or just plain unittest/unittest2.
Installation and quick start¶
On most UNIX-like systems, you’ll probably need to run these commands as root or using sudo.
Install nose using setuptools/distribute:
Or pip:
Or, if you don’t have setuptools/distribute installed, use the download link at right to download the source package, and install it in the normal fashion: Ungzip and untar the source package, cd to the new directory, and:
However, please note that without setuptools/distribute installed, you will not be able to use third-party nose plugins.
This will install the nose libraries, as well as the nosetestsscript, which you can use to automatically discover and run tests.
Now you can run tests for your project:
cd path/to/project nosetests
You should see output something like this:
..................................
Ran 34 tests in 1.440s
OK
Indicating that nose found and ran your tests.
For help with nosetests’ many command-line options, try:
or visit the usage documentation.
Python3¶
nose supports python3. Building from source on python3 requiresdistribute. If you don’t have distribute installed, python3 setup.py install
will install it via distribute’s bootstrap script.
Additionally, if your project is using 2to3, python3 setup.py nosetests
command will automatically convert your sources with 2to3 and then run the tests with python 3.
Warning
nose itself supports python 3, but many 3rd-party plugins do not!
Documentation
Testing with nose Find out how to write, find and run tests using nose. More > | Developing with nose Find out how to write your own plugins, and about nose internals. More > |
---|---|
News What's new in this release? More > | Further reading Plugin recipes and usage examples, trivia and other uncategorizable items. More > |
Indices and tables Complete index Index of documented modules |