summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/unittest.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/unittest.py b/Lib/unittest.py
index 7dac499..a023c67 100644
--- a/Lib/unittest.py
+++ b/Lib/unittest.py
@@ -339,7 +339,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))
@@ -351,7 +351,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))