summaryrefslogtreecommitdiff
path: root/test/DocutilsTestSupport.py
diff options
context:
space:
mode:
authorwiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2004-09-13 18:16:41 +0000
committerwiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2004-09-13 18:16:41 +0000
commitccd56c100333ddaed257f53f892ee6ee3f4db3f5 (patch)
treecc4b19bf686db0c49ed29afd251392dd7c5b092e /test/DocutilsTestSupport.py
parent097eea916324344e93db305e0faf43adbca92cc5 (diff)
downloaddocutils-ccd56c100333ddaed257f53f892ee6ee3f4db3f5.tar.gz
removed floating point comparison methods
If we need them, they're in the history now. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@2605 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'test/DocutilsTestSupport.py')
-rw-r--r--test/DocutilsTestSupport.py39
1 files changed, 4 insertions, 35 deletions
diff --git a/test/DocutilsTestSupport.py b/test/DocutilsTestSupport.py
index 4b45831cb..6272557aa 100644
--- a/test/DocutilsTestSupport.py
+++ b/test/DocutilsTestSupport.py
@@ -87,11 +87,10 @@ class CustomTestCase(unittest.TestCase):
Helper class, providing extended functionality over unittest.TestCase.
This isn't specific to Docutils but of general use when dealing
- with large amounts of text. The methods failUnlessEqual,
- failIfEqual, failUnlessAlmostEqual and failIfAlmostEqual have been
- overwritten to provide better support for multi-line strings.
- Furthermore, see the compare_output method and the parameter list
- of __init__.
+ with large amounts of text. The methods failUnlessEqual and
+ failIfEqual have been overwritten to provide better support for
+ multi-line strings. Furthermore, see the compare_output method
+ and the parameter list of __init__.
"""
compare = docutils_difflib.Differ().compare
@@ -161,42 +160,12 @@ class CustomTestCase(unittest.TestCase):
raise self.failureException, \
(msg or '%s == %s' % _format_str(first, second))
- 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.
-
- 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:
- raise self.failureException, \
- (msg or '%s != %s within %s places' %
- _format_str(first, second, places))
-
- 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.
-
- 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:
- raise self.failureException, \
- (msg or '%s == %s within %s places' %
- _format_str(first, second, places))
-
# Synonyms for assertion methods
assertEqual = assertEquals = failUnlessEqual
assertNotEqual = assertNotEquals = failIfEqual
- assertAlmostEqual = assertAlmostEquals = failUnlessAlmostEqual
-
- assertNotAlmostEqual = assertNotAlmostEquals = failIfAlmostEqual
-
class CustomTestSuite(unittest.TestSuite):