[Python-checkins] r86119 - in python/branches/release31-maint: Doc/library/unittest.rst Lib/unittest.py Misc/NEWS

michael.foord python-checkins at python.org
Tue Nov 2 15:46:41 CET 2010


Author: michael.foord
Date: Tue Nov  2 15:46:41 2010
New Revision: 86119

Log:
Removing the keyword only restriction for the places argument in unittest.TestCase.assert[Not]AlmostEqual

Modified:
   python/branches/release31-maint/Doc/library/unittest.rst
   python/branches/release31-maint/Lib/unittest.py
   python/branches/release31-maint/Misc/NEWS

Modified: python/branches/release31-maint/Doc/library/unittest.rst
==============================================================================
--- python/branches/release31-maint/Doc/library/unittest.rst	(original)
+++ python/branches/release31-maint/Doc/library/unittest.rst	Tue Nov  2 15:46:41 2010
@@ -652,8 +652,8 @@
          :meth:`failIfEqual`.
 
 
-   .. method:: assertAlmostEqual(first, second, *, places=7, msg=None)
-               failUnlessAlmostEqual(first, second, *, places=7, msg=None)
+   .. method:: assertAlmostEqual(first, second, places=7, msg=None)
+               failUnlessAlmostEqual(first, second, places=7, msg=None)
 
       Test that *first* and *second* are approximately equal by computing the
       difference, rounding to the given number of decimal *places* (default 7),
@@ -668,8 +668,8 @@
          :meth:`failUnlessAlmostEqual`.
 
 
-   .. method:: assertNotAlmostEqual(first, second, *, places=7, msg=None)
-               failIfAlmostEqual(first, second, *, places=7, msg=None)
+   .. method:: assertNotAlmostEqual(first, second, places=7, msg=None)
+               failIfAlmostEqual(first, second, places=7, msg=None)
 
       Test that *first* and *second* are not approximately equal by computing
       the difference, rounding to the given number of decimal *places* (default

Modified: python/branches/release31-maint/Lib/unittest.py
==============================================================================
--- python/branches/release31-maint/Lib/unittest.py	(original)
+++ python/branches/release31-maint/Lib/unittest.py	Tue Nov  2 15:46:41 2010
@@ -634,7 +634,7 @@
             msg = self._formatMessage(msg, '%r == %r' % (first, second))
             raise self.failureException(msg)
 
-    def assertAlmostEqual(self, first, second, *, places=7, msg=None):
+    def assertAlmostEqual(self, first, second, places=7, msg=None):
         """Fail if the two objects are unequal as determined by their
            difference rounded to the given number of decimal places
            (default 7) and comparing to zero.
@@ -647,7 +647,7 @@
             msg = self._formatMessage(msg, standardMsg)
             raise self.failureException(msg)
 
-    def assertNotAlmostEqual(self, first, second, *, places=7, msg=None):
+    def assertNotAlmostEqual(self, first, second, places=7, msg=None):
         """Fail if the two objects are equal as determined by their
            difference rounded to the given number of decimal places
            (default 7) and comparing to zero.

Modified: python/branches/release31-maint/Misc/NEWS
==============================================================================
--- python/branches/release31-maint/Misc/NEWS	(original)
+++ python/branches/release31-maint/Misc/NEWS	Tue Nov  2 15:46:41 2010
@@ -143,6 +143,9 @@
 Library
 -------
 
+- The keyword only restriction for the places argument in
+  unittest.TestCase.assert[Not]AlmostEqual methods has been removed.
+
 - Issue 6706: asyncore accept() method no longer raises EWOULDBLOCK/ECONNABORTED
   on incomplete connection attempt but returns None instead.
 


More information about the Python-checkins mailing list