[Python-checkins] r86173 - python/branches/py3k/Doc/library/unittest.rst

ezio.melotti python-checkins at python.org
Thu Nov 4 20:09:28 CET 2010


Author: ezio.melotti
Date: Thu Nov  4 20:09:28 2010
New Revision: 86173

Log:
Move the deprecated aliases in a new section.

Modified:
   python/branches/py3k/Doc/library/unittest.rst

Modified: python/branches/py3k/Doc/library/unittest.rst
==============================================================================
--- python/branches/py3k/Doc/library/unittest.rst	(original)
+++ python/branches/py3k/Doc/library/unittest.rst	Thu Nov  4 20:09:28 2010
@@ -809,7 +809,6 @@
 
 
    .. method:: assertEqual(first, second, msg=None)
-               failUnlessEqual(first, second, msg=None)
 
       Test that *first* and *second* are equal.  If the values do not compare
       equal, the test will fail with the explanation given by *msg*, or
@@ -831,12 +830,8 @@
          :meth:`assertMultiLineEqual` added as the default type equality
          function for comparing strings.
 
-      .. deprecated:: 3.1
-         :meth:`failUnlessEqual`; use :meth:`assertEqual`.
-
 
    .. method:: assertNotEqual(first, second, msg=None)
-               failIfEqual(first, second, msg=None)
 
       Test that *first* and *second* are not equal.  If the values do compare
       equal, the test will fail with the explanation given by *msg*, or
@@ -845,31 +840,19 @@
       default value for *msg* can be computed to include representations of both
       *first* and *second*.
 
-      .. deprecated:: 3.1
-         :meth:`failIfEqual`; use :meth:`assertNotEqual`.
-
 
    .. method:: assertTrue(expr, msg=None)
-               assert_(expr, msg=None)
-               failUnless(expr, msg=None)
 
       Signal a test failure if *expr* is false; the explanation for the failure
       will be *msg* if given, otherwise it will be :const:`None`.
 
-      .. deprecated:: 3.1
-         :meth:`failUnless` and :meth:`assert_`; use :meth:`assertTrue`.
-
 
    .. method:: assertFalse(expr, msg=None)
-               failIf(expr, msg=None)
 
       The inverse of the :meth:`assertTrue` method is the :meth:`assertFalse` method.
       This signals a test failure if *expr* is true, with *msg* or :const:`None`
       for the error message.
 
-      .. deprecated:: 3.1
-         :meth:`failIf`; use :meth:`assertFalse`.
-
 
    .. method:: assertIs(first, second, msg=None)
                assertIsNot(first, second, msg=None)
@@ -929,9 +912,7 @@
    +---------------------------------------------------------+--------------------------------------+------------+
 
    .. method:: assertRaises(exception, callable, *args, **kwds)
-               failUnlessRaises(exception, callable, *args, **kwds)
                assertRaises(exception)
-               failUnlessRaises(exception)
 
       Test that an exception is raised when *callable* is called with any
       positional or keyword arguments that are also passed to
@@ -962,9 +943,6 @@
       .. versionchanged:: 3.2
          Added the :attr:`exception` attribute.
 
-      .. deprecated:: 3.1
-         :meth:`failUnlessRaises`; use :meth:`assertRaises`.
-
 
    .. method:: assertRaisesRegexp(exception, regexp, callable, *args, **kwds)
                assertRaisesRegexp(exception, regexp)
@@ -1079,7 +1057,6 @@
 
 
    .. method:: assertAlmostEqual(first, second, places=7, msg=None, delta=None)
-               failUnlessAlmostEqual(first, second, places=7, msg=None, delta=None)
 
       Test that *first* and *second* are approximately equal by computing the
       difference, rounding to the given number of decimal *places* (default 7),
@@ -1099,12 +1076,8 @@
          Objects that compare equal are automatically almost equal.
          Added the ``delta`` keyword argument.
 
-      .. deprecated:: 3.1
-         :meth:`failUnlessAlmostEqual`; use :meth:`assertAlmostEqual`.
-
 
    .. method:: assertNotAlmostEqual(first, second, places=7, msg=None, delta=None)
-               failIfAlmostEqual(first, second, places=7, msg=None, delta=None)
 
       Test that *first* and *second* are not approximately equal by computing
       the difference, rounding to the given number of decimal *places* (default
@@ -1124,9 +1097,6 @@
          Objects that compare equal automatically fail.  Added the ``delta``
          keyword argument.
 
-      .. deprecated:: 3.1
-         :meth:`failIfAlmostEqual`; use :meth:`assertNotAlmostEqual`.
-
 
    .. method:: assertGreater(first, second, msg=None)
                assertGreaterEqual(first, second, msg=None)
@@ -1452,6 +1422,30 @@
    :mod:`unittest`-based test framework.
 
 
+Deprecated aliases
+##################
+
+For historical reasons, some of the :class:`TestCase` methods had one or more
+aliases that are now deprecated.  The following table lists the correct names
+along with their deprecated aliases:
+
+   ==============================  ===============================
+    Method Name                     Deprecated alias(es)
+   ==============================  ===============================
+    :meth:`.assertEqual`            failUnlessEqual, assertEquals
+    :meth:`.assertNotEqual`         failIfEqual
+    :meth:`.assertTrue`             failUnless, assert\_
+    :meth:`.assertFalse`            failIf
+    :meth:`.assertRaises`           failUnlessRaises
+    :meth:`.assertAlmostEqual`      failUnlessAlmostEqual
+    :meth:`.assertNotAlmostEqual`   failIfAlmostEqual
+   ==============================  ===============================
+
+   .. deprecated:: 3.1
+         the aliases listed in the second column
+
+
+
 .. _testsuite-objects:
 
 Grouping tests


More information about the Python-checkins mailing list