8000 Change docs to recommend tests.py rather than setup.py test by jenshnielsen · Pull Request #5462 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Change docs to recommend tests.py rather than setup.py test #5462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

8000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@ Testing

After installation, you can launch the test suite::

python setup.py test
python tests.py

Or from the python interpreter::

import matplotlib
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
=======
Expand Down
2 changes: 1 addition & 1 deletion doc/devel/release_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 18 additions & 20 deletions doc/devel/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
0