diff options
Diffstat (limited to 'Lib/unittest.py')
-rw-r--r-- | Lib/unittest.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/unittest.py b/Lib/unittest.py index 7ea240c6af..eccefe6026 100644 --- a/Lib/unittest.py +++ b/Lib/unittest.py @@ -358,7 +358,7 @@ class TestCase: Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit). """ - if round(second-first, places) != 0: + if round(abs(second-first), places) != 0: raise self.failureException, \ (msg or '%r != %r within %r places' % (first, second, places)) @@ -370,7 +370,7 @@ class TestCase: Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit). """ - if round(second-first, places) == 0: + if round(abs(second-first), places) == 0: raise self.failureException, \ (msg or '%r == %r within %r places' % (first, second, places)) |