Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Standalone test script #31

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
1 commit merged into from
Mar 7, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions doc/devel/coding_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Coding guide
************

Committing changes
------------------
==================

When committing changes to matplotlib, there are a few things to bear
in mind.
Expand Down Expand Up @@ -358,7 +358,6 @@ object::
print 'datafile', datafile


.. _license-discussion:



Expand All @@ -376,17 +375,31 @@ please ignore it while we consolidate our testing to these locations.)
Running the tests
-----------------

Running the tests is simple. Make sure you have nose installed and
type from within Python::
Running the tests is simple. Make sure you have nose installed and run
the script :file:`tests.py` in the root directory of the distribution.
The script can take any of the usual `nosetest arguments`_, such as

=================== ===========
``-v`` increase verbosity
``-d`` detailed error messages
``--with-coverage`` enable collecting coverage information
=================== ===========

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, eg. (this is assuming the test is installed)::

python tests.py matplotlib.tests.test_simplification:test_clipping

An alternative implementation that does not look at command line
arguments works from within Python::

import matplotlib
matplotlib.test()

To run a single test from the command line, you can provide
a dot-separated path to the module and function, eg.
(this is assuming the test is installed)::

nosetests matplotlib.tests.test_simplification:test_clipping
.. _`nosetest arguments`: http://somethingaboutorange.com/mrl/projects/nose/1.0.0/usage.html



Writing a simple test
Expand Down Expand Up @@ -482,6 +495,8 @@ Let's say you've added a new module named
the list of default tests, append its name to ``default_test_modules``
in :file:`lib/matplotlib/__init__.py`.

.. _license-discussion:

Licenses
========

Expand Down
17 changes: 17 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python
#
# This allows running the matplotlib tests from the command line: e.g.
# python tests.py -v -d
# See http://somethingaboutorange.com/mrl/projects/nose/1.0.0/usage.html
# for options.

import nose
from matplotlib.testing.noseclasses import KnownFailure
from matplotlib import default_test_modules

def run():
nose.main(addplugins=[KnownFailure()],
defaultTest=default_test_modules)

if __name__ == '__main__':
run()