|
1 | 1 | Development |
2 | 2 | =========== |
3 | 3 |
|
4 | | -In order to work on quantities development, after installing the dependencies, |
5 | | -it is recommended to do the following:: |
| 4 | +Quantities development uses the principles of test-driven development. New |
| 5 | +features or bug fixes need to be accompanied by unit tests based on Python's |
| 6 | +unittest package. Unit tests can be run with the following:: |
6 | 7 |
|
7 | | - python setup.py develop |
| 8 | + python setup.py test |
8 | 9 |
|
9 | | -This uses setuptools to install a link in your site-packages directory which |
10 | | -points to your source directory. This allows you to make changes in the source |
11 | | -directory without having to reinstall quantities. Note, however, that after |
12 | | -changing extension code, which needs to be compiled, you will need to run |
13 | | -"python setup.py develop" again. Also note that executable scripts are copied |
14 | | -to their install directory, rather than being linked, so you need to run |
15 | | -"python setup.py develop" after editing scripts. |
16 | | - |
17 | | -Unit tests are collected by the nose package, and can be run with the following:: |
18 | | - |
19 | | - python setup.py nosetests --with-coverage --cover-package=quantities \ |
20 | | - --cover-erase --cover-tests |
21 | | - |
22 | | -This assumes you have both nose_ and coverage_ installed on your system. |
23 | | - |
24 | | -.. _nose: http://somethingaboutorange.com/mrl/projects/nose |
25 | | -.. _coverage: http://nedbatchelder.com/code/modules/rees-coverage.html |
| 10 | +This works with the version of unittest provided by the python-2.7 and |
| 11 | +python-3.2 standard library. If you are running python-2.6 or python-3.1, you |
| 12 | +need to install unittest2 to run the test suite. |
0 commit comments