summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-08-11 10:04:50 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-08-11 10:04:50 (GMT)
commitd51914c6c1009efaa898824170e2702541d80009 (patch)
treedac8380e59533a5495de0683c0b7e900d9a2e1bf /Lib
parent7608b607b1b40353a01da15ff6b2240539446a09 (diff)
downloadcpython-d51914c6c1009efaa898824170e2702541d80009.zip
cpython-d51914c6c1009efaa898824170e2702541d80009.tar.gz
cpython-d51914c6c1009efaa898824170e2702541d80009.tar.bz2
#18663: document that assertAlmostEqual also works when the values are equal and add tests.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/unittest/test/test_assertions.py4
1 files changed, 4 insertions, 0 deletions
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,