Objects that compare equal automatically pass or fail assertAlmostEqual and assertNotAlmostEqual tests on unittest.TestCase. Issue 6567.

This commit is contained in:
Michael Foord 2009-09-13 16:40:02 +00:00
parent 60931a5a58
commit c3f79373e8
4 changed files with 24 additions and 1 deletions

View file

@ -2989,6 +2989,11 @@ class Test_Assertions(TestCase):
self.assertRaises(self.failureException,
self.assertNotAlmostEqual, 0, .1+.1j, places=0)
self.assertAlmostEqual(float('inf'), float('inf'))
self.assertRaises(self.failureException, self.assertNotAlmostEqual,
float('inf'), float('inf'))
def test_assertRaises(self):
def _raise(e):
raise e