diff options
| author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2012-02-03 08:16:53 +0000 |
|---|---|---|
| committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2012-02-03 08:16:53 +0000 |
| commit | e6e175e40d90682951ea2a69adafe3f0e4577179 (patch) | |
| tree | a360be348114a04b811edfe8dda3a4a06a1f9f19 /docutils/test/DocutilsTestSupport.py | |
| parent | 863555ec165e492c2b540805bcd212397bb5b1b6 (diff) | |
| download | docutils-e6e175e40d90682951ea2a69adafe3f0e4577179.tar.gz | |
Replace deprecated aliases for assert methods with correct names.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7337 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test/DocutilsTestSupport.py')
| -rw-r--r-- | docutils/test/DocutilsTestSupport.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/docutils/test/DocutilsTestSupport.py b/docutils/test/DocutilsTestSupport.py index 1d1276cca..5cf95e6fc 100644 --- a/docutils/test/DocutilsTestSupport.py +++ b/docutils/test/DocutilsTestSupport.py @@ -107,7 +107,7 @@ class StandardTestCase(unittest.TestCase): def setUp(self): os.chdir(testroot) - def failUnlessEqual(self, first, second, msg=None): + def assertEqual(self, first, second, msg=None): """Fail if the two objects are unequal as determined by the '==' operator. """ @@ -115,7 +115,7 @@ class StandardTestCase(unittest.TestCase): raise self.failureException, \ (msg or '%s != %s' % _format_str(first, second)) - def failIfEqual(self, first, second, msg=None): + def assertNotEqual(self, first, second, msg=None): """Fail if the two objects are equal as determined by the '==' operator. """ @@ -123,11 +123,11 @@ class StandardTestCase(unittest.TestCase): raise self.failureException, \ (msg or '%s == %s' % _format_str(first, second)) - # Synonyms for assertion methods + # aliases for assertion methods, deprecated since Python 2.7 - assertEqual = assertEquals = failUnlessEqual + failUnlessEqual = assertEquals = assertEqual - assertNotEqual = assertNotEquals = failIfEqual + assertNotEquals = failIfEqual = assertNotEqual class CustomTestCase(StandardTestCase): @@ -135,7 +135,7 @@ class CustomTestCase(StandardTestCase): """ Helper class, providing extended functionality over unittest.TestCase. - The methods failUnlessEqual and failIfEqual have been overwritten + The methods assertEqual and assertNotEqual have been overwritten to provide better support for multi-line strings. Furthermore, see the compare_output method and the parameter list of __init__. """ @@ -209,7 +209,7 @@ class CustomTestCase(StandardTestCase): if output: output = '\n'.join(output.splitlines()) try: - self.assertEquals(output, expected) + self.assertEqual(output, expected) except AssertionError, error: print >>sys.stderr, '\n%s\ninput:' % (self,) print >>sys.stderr, input |
