diff --git a/README.rst b/README.rst index fa12a3bfa1bb..43dc7c0575ca 100644 --- a/README.rst +++ b/README.rst @@ -20,7 +20,7 @@ Testing After installation, you can launch the test suite:: - python setup.py test + python tests.py Or from the python interpreter:: @@ -28,7 +28,9 @@ Or from the python interpreter:: matplotlib.test() Consider reading http://matplotlib.org/devel/coding_guide.html#testing for -more information. +more information. Note that the test suite requires nose and on python 2.7 mock +which are not installed by default. Please install with pip or your package +manager of choice. Contact ======= diff --git a/doc/devel/release_guide.rst b/doc/devel/release_guide.rst index 844b721437ea..fd8ea2a2f046 100644 --- a/doc/devel/release_guide.rst +++ b/doc/devel/release_guide.rst @@ -13,7 +13,7 @@ A guide for developers who are doing a matplotlib release. Testing ======= -* Run all of the regression tests by running ``python setup.py test`` script +* Run all of the regression tests by running ``python tests.py`` at the root of the source tree. * Run :file:`unit/memleak_hawaii3.py` and make sure there are no diff --git a/doc/devel/testing.rst b/doc/devel/testing.rst index ddce97568e71..4c1617646722 100644 --- a/doc/devel/testing.rst +++ b/doc/devel/testing.rst @@ -36,43 +36,40 @@ Optionally you can install: Running the tests ----------------- -Running the tests is simple. Make sure you have nose installed and run -the setup script's ``test`` command:: +Running the tests is simple. Make sure you have nose installed and run:: - python setup.py test + python tests.py in the root directory of the distribution. The script takes a set of commands, such as: ======================== =========== -``--pep8-only`` pep8 checks -``--omit-pep8`` Do not perform pep8 checks -``--nocapture`` do not capture stdout (nosetests) -``--nose-verbose`` be verbose (nosetests) -``--processes`` number of processes (nosetests) -``--process-timeout`` process timeout (nosetests) -``--with-coverage`` with coverage -``--detailed-error-msg`` detailed error message (nosetest) -``--tests`` comma separated selection of tests (nosetest) +``--pep8`` pep8 checks +``--no-pep8`` Do not perform pep8 checks +``--no-network`` Disable tests that require network access ======================== =========== -Additionally it is possible to run only coding standard test or disable them: +Additional arguments are passed on to nosetests. See the nose +documentation for supported arguments. Some of the more important ones are given +here: -=================== =========== -``--pep8`` run only PEP8 checks -``--no-pep8`` disable PEP8 checks -=================== =========== +============================= =========== +``--verbose`` Be more verbose +``--processes=NUM`` Run tests in parallel over NUM processes +``--process-timeout=SECONDS`` Set timeout for results from test runner process +``--nocapture`` Do not capture stdout +============================= =========== To run a single test from the command line, you can provide a dot-separated path to the module followed by the function separated by a colon, e.g., (this is assuming the test is installed):: - python setup.py test --tests=matplotlib.tests.test_simplification:test_clipping + python tests.py matplotlib.tests.test_simplification:test_clipping If you want to run the full test suite, but want to save wall time try running the tests in parallel:: - python setup.py test --nocapture --nose-verbose --processes=5 --process-timeout=300 + python tests.py --nocapture --nose-verbose --processes=5 --process-timeout=300 An alternative implementation that does not look at command line @@ -84,9 +81,10 @@ matplotlib library function :func:`matplotlib.test`:: .. hint:: - You might need to install nose for this:: + To run the tests you need to install nose and mock if using python 2.7:: pip install nose + pip install mock .. _`nosetest arguments`: http://nose.readthedocs.org/en/latest/usage.html