[Numpy-svn] r5742 - trunk/doc

numpy-svn@scip... numpy-svn@scip...
Tue Sep 2 15:13:20 CDT 2008


Author: jarrod.millman
Date: 2008-09-02 15:13:17 -0500 (Tue, 02 Sep 2008)
New Revision: 5742

Added:
   trunk/doc/TESTS.txt
Modified:
   trunk/doc/DISTUTILS.txt
Log:
pulling out testing docs from distutils docs


Modified: trunk/doc/DISTUTILS.txt
===================================================================
--- trunk/doc/DISTUTILS.txt	2008-09-02 06:59:43 UTC (rev 5741)
+++ trunk/doc/DISTUTILS.txt	2008-09-02 20:13:17 UTC (rev 5742)
@@ -453,58 +453,6 @@
   from numpy.testing import NumpyTest
   test = NumpyTest().test
 
-The ``tests/`` directory
-''''''''''''''''''''''''
-
-Ideally, every Python code, extension module, or subpackage in Scipy
-package directory should have the corresponding ``test_<name>.py``
-file in ``tests/`` directory.  This file should define classes
-derived from the ``numpy.testing.TestCase`` class (or from 
-``unittest.TestCase``) and have names starting with ``test``. The methods
-of these classes whose names contain ``test`` or start with ``bench`` are 
-automatically picked up by the test machinery. 
-
-A minimal example of a ``test_yyy.py`` file that implements tests for
-a NumPy package module ``numpy.xxx.yyy`` containing a function
-``zzz()``, is shown below::
-
-  import sys
-  from numpy.testing import *
-
-  # import xxx symbols
-  from numpy.xxx.yyy import zzz
-
-
-  class test_zzz(TestCase):
-      def test_simple(self, level=1):
-          assert zzz()=='Hello from zzz'
-      #...
-
-  if __name__ == "__main__":
-      run_module_tests(file)
-
-Note that all classes that are inherited from ``TestCase`` class, are
-automatically picked up by the test runner.
-
-``numpy.testing`` module provides also the following convenience
-functions::
-
-  assert_equal(actual,desired,err_msg='',verbose=1)
-  assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=1)
-  assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=1)
-  assert_array_equal(x,y,err_msg='')
-  assert_array_almost_equal(x,y,decimal=6,err_msg='')
-  rand(*shape) # returns random array with a given shape
-
-To run all test scripts of the module ``xxx``, execute in Python:
-
-  >>> import numpy
-  >>> numpy.xxx.test()
-
-To run only tests for ``xxx.yyy`` module, execute:
-
-  >>> NumpyTest('xxx.yyy').test(level=1,verbosity=1)
-
 Extra features in NumPy Distutils
 '''''''''''''''''''''''''''''''''
 

Added: trunk/doc/TESTS.txt
===================================================================
--- trunk/doc/TESTS.txt	2008-09-02 06:59:43 UTC (rev 5741)
+++ trunk/doc/TESTS.txt	2008-09-02 20:13:17 UTC (rev 5742)
@@ -0,0 +1,52 @@
+The ``tests/`` directory
+''''''''''''''''''''''''
+
+Ideally, every Python code, extension module, or subpackage in Scipy
+package directory should have the corresponding ``test_<name>.py``
+file in ``tests/`` directory.  This file should define classes
+derived from the ``numpy.testing.TestCase`` class (or from
+``unittest.TestCase``) and have names starting with ``test``. The methods
+of these classes whose names contain ``test`` or start with ``bench`` are
+automatically picked up by the test machinery.
+
+A minimal example of a ``test_yyy.py`` file that implements tests for
+a NumPy package module ``numpy.xxx.yyy`` containing a function
+``zzz()``, is shown below::
+
+  import sys
+  from numpy.testing import *
+
+  # import xxx symbols
+  from numpy.xxx.yyy import zzz
+
+
+  class test_zzz(TestCase):
+      def test_simple(self, level=1):
+          assert zzz()=='Hello from zzz'
+      #...
+
+  if __name__ == "__main__":
+      run_module_tests(file)
+
+Note that all classes that are inherited from ``TestCase`` class, are
+automatically picked up by the test runner.
+
+``numpy.testing`` module provides also the following convenience
+functions::
+
+  assert_equal(actual,desired,err_msg='',verbose=1)
+  assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=1)
+  assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=1)
+  assert_array_equal(x,y,err_msg='')
+  assert_array_almost_equal(x,y,decimal=6,err_msg='')
+  rand(*shape) # returns random array with a given shape
+
+To run all test scripts of the module ``xxx``, execute in Python:
+
+  >>> import numpy
+  >>> numpy.xxx.test()
+
+To run only tests for ``xxx.yyy`` module, execute:
+
+  >>> NumpyTest('xxx.yyy').test(level=1,verbosity=1)
+



More information about the Numpy-svn mailing list