mirror of
https://github.com/python/cpython.git
synced 2025-08-28 04:35:02 +00:00
parent
ecfeb7f095
commit
70a6b49821
246 changed files with 926 additions and 962 deletions
|
@ -330,7 +330,7 @@ class TestCase:
|
|||
"""
|
||||
if not first == second:
|
||||
raise self.failureException, \
|
||||
(msg or '%s != %s' % (`first`, `second`))
|
||||
(msg or '%r != %r' % (first, second))
|
||||
|
||||
def failIfEqual(self, first, second, msg=None):
|
||||
"""Fail if the two objects are equal as determined by the '=='
|
||||
|
@ -338,7 +338,7 @@ class TestCase:
|
|||
"""
|
||||
if first == second:
|
||||
raise self.failureException, \
|
||||
(msg or '%s == %s' % (`first`, `second`))
|
||||
(msg or '%r == %r' % (first, second))
|
||||
|
||||
def failUnlessAlmostEqual(self, first, second, places=7, msg=None):
|
||||
"""Fail if the two objects are unequal as determined by their
|
||||
|
@ -350,7 +350,7 @@ class TestCase:
|
|||
"""
|
||||
if round(second-first, places) != 0:
|
||||
raise self.failureException, \
|
||||
(msg or '%s != %s within %s places' % (`first`, `second`, `places` ))
|
||||
(msg or '%r != %r within %r places' % (first, second, places))
|
||||
|
||||
def failIfAlmostEqual(self, first, second, places=7, msg=None):
|
||||
"""Fail if the two objects are equal as determined by their
|
||||
|
@ -362,7 +362,7 @@ class TestCase:
|
|||
"""
|
||||
if round(second-first, places) == 0:
|
||||
raise self.failureException, \
|
||||
(msg or '%s == %s within %s places' % (`first`, `second`, `places`))
|
||||
(msg or '%r == %r within %r places' % (first, second, places))
|
||||
|
||||
# Synonyms for assertion methods
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue