summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/library/unittest.rst2
-rw-r--r--Lib/unittest/test/test_assertions.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index 845bf0a..0c00a26 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -1000,7 +1000,7 @@ Test cases
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
index d43fe5a..7931cad 100644
--- a/Lib/unittest/test/test_assertions.py
+++ b/Lib/unittest/test/test_assertions.py
@@ -34,6 +34,10 @@ class Test_Assertions(unittest.TestCase):
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,