mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Add a test for fail*AlmostEqual, including the new support for complex numbers.
This commit is contained in:
parent
96593ed348
commit
aaaef110dc
2 changed files with 24 additions and 3 deletions
|
@ -331,7 +331,7 @@ class TestCase:
|
|||
if first == second:
|
||||
raise self.failureException(msg or '%r == %r' % (first, second))
|
||||
|
||||
def failUnlessAlmostEqual(self, first, second, places=7, msg=None):
|
||||
def failUnlessAlmostEqual(self, first, second, *, places=7, msg=None):
|
||||
"""Fail if the two objects are unequal as determined by their
|
||||
difference rounded to the given number of decimal places
|
||||
(default 7) and comparing to zero.
|
||||
|
@ -343,7 +343,7 @@ class TestCase:
|
|||
raise self.failureException(msg or '%r != %r within %r places'
|
||||
% (first, second, places))
|
||||
|
||||
def failIfAlmostEqual(self, first, second, places=7, msg=None):
|
||||
def failIfAlmostEqual(self, first, second, *, places=7, msg=None):
|
||||
"""Fail if the two objects are equal as determined by their
|
||||
difference rounded to the given number of decimal places
|
||||
(default 7) and comparing to zero.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue