diff options
| author | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-07-06 16:37:24 +0000 |
|---|---|---|
| committer | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-07-06 16:37:24 +0000 |
| commit | a7b824d7ad0eff627ac66957f96e4c40d93bbdaa (patch) | |
| tree | a682af8937309c7fee86f4ad96bdb54d5812e5f5 /docutils/test/DocutilsTestSupport.py | |
| parent | 0092477541d268717ae82f973f67ffc03fdec282 (diff) | |
| download | docutils-a7b824d7ad0eff627ac66957f96e4c40d93bbdaa.tar.gz | |
moved comparison methods up to StandardTestCase
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@3662 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test/DocutilsTestSupport.py')
| -rw-r--r-- | docutils/test/DocutilsTestSupport.py | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/docutils/test/DocutilsTestSupport.py b/docutils/test/DocutilsTestSupport.py index c0c2c331b..0466590fd 100644 --- a/docutils/test/DocutilsTestSupport.py +++ b/docutils/test/DocutilsTestSupport.py @@ -93,12 +93,34 @@ class StandardTestCase(unittest.TestCase): """ Helper class, providing the same interface as unittest.TestCase, - but with useful setUp and tearDown methods. + but with useful setUp and comparison methods. """ def setUp(self): os.chdir(testroot) + def failUnlessEqual(self, first, second, msg=None): + """Fail if the two objects are unequal as determined by the '==' + operator. + """ + if not first == second: + raise self.failureException, \ + (msg or '%s != %s' % _format_str(first, second)) + + def failIfEqual(self, first, second, msg=None): + """Fail if the two objects are equal as determined by the '==' + operator. + """ + if first == second: + raise self.failureException, \ + (msg or '%s == %s' % _format_str(first, second)) + + # Synonyms for assertion methods + + assertEqual = assertEquals = failUnlessEqual + + assertNotEqual = assertNotEquals = failIfEqual + class CustomTestCase(StandardTestCase): @@ -167,28 +189,6 @@ class CustomTestCase(StandardTestCase): print >>sys.stderr, 'output: %r' % output raise error - def failUnlessEqual(self, first, second, msg=None): - """Fail if the two objects are unequal as determined by the '==' - operator. - """ - if not first == second: - raise self.failureException, \ - (msg or '%s != %s' % _format_str(first, second)) - - def failIfEqual(self, first, second, msg=None): - """Fail if the two objects are equal as determined by the '==' - operator. - """ - if first == second: - raise self.failureException, \ - (msg or '%s == %s' % _format_str(first, second)) - - # Synonyms for assertion methods - - assertEqual = assertEquals = failUnlessEqual - - assertNotEqual = assertNotEquals = failIfEqual - class CustomTestSuite(unittest.TestSuite): |
