[Python-checkins] cpython (merge 3.3 -> default): #18663: merge with 3.3.

ezio.melotti python-checkins at python.org
Sun Aug 11 12:07:06 CEST 2013


http://hg.python.org/cpython/rev/eeda59e08c83
changeset:   85120:eeda59e08c83
parent:      85118:9b0e9e9812f8
parent:      85119:e0f86c3b3685
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Sun Aug 11 13:05:37 2013 +0300
summary:
  #18663: merge with 3.3.

files:
  Doc/library/unittest.rst             |  2 +-
  Lib/unittest/test/test_assertions.py |  4 ++++
  2 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -1077,7 +1077,7 @@
       like the :func:`round` function) and not *significant digits*.
 
       If *delta* is supplied instead of *places* then the difference
-      between *first* and *second* must be less (or more) than *delta*.
+      between *first* and *second* must be less or equal to (or greater than) *delta*.
 
       Supplying both *delta* and *places* raises a ``TypeError``.
 
diff --git a/Lib/unittest/test/test_assertions.py b/Lib/unittest/test/test_assertions.py
--- a/Lib/unittest/test/test_assertions.py
+++ b/Lib/unittest/test/test_assertions.py
@@ -34,6 +34,10 @@
         self.assertNotAlmostEqual(1.1, 1.0, delta=0.05)
         self.assertNotAlmostEqual(1.0, 1.1, delta=0.05)
 
+        self.assertAlmostEqual(1.0, 1.0, delta=0.5)
+        self.assertRaises(self.failureException, self.assertNotAlmostEqual,
+                          1.0, 1.0, delta=0.5)
+
         self.assertRaises(self.failureException, self.assertAlmostEqual,
                           1.1, 1.0, delta=0.05)
         self.assertRaises(self.failureException, self.assertNotAlmostEqual,

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list