summaryrefslogtreecommitdiff
path: root/doc/index.rst
blob: b26a723c3a41e1cb18c9e1fe477666212b23d0c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
.. nose documentation master file, created by sphinx-quickstart on Thu Mar 26 16:49:00 2009.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.


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 <https://github.com/nose-devs/nose2>`_, `py.test
<http://pytest.org/>`_, 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::

  easy_install nose

Or pip::

  pip install nose

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::

  python setup.py install

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 :doc:`nosetests <usage>`
script, 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::

  nosetests -h

or visit the :doc:`usage documentation <usage>`.


Python3
=======

nose supports python3. Building from source on python3 requires
`distribute <http://packages.python.org/distribute/>`_. 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
<http://docs.python.org/library/2to3.html>`_, ``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!


.. toctree::
   :hidden:

   testing
   developing
   news
   further_reading