diff options
author | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-06-05 13:57:23 (GMT) |
---|---|---|
committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-06-05 13:57:23 (GMT) |
commit | ac76074628b0a3aea78cc85c79034bb7d04b68f4 (patch) | |
tree | 8b73eb5504a859366fbaac46ba041ab079055d77 /Lib/unittest/test | |
parent | 9dad32efe8e63cda4de3b53004598d2c1f6aa129 (diff) | |
download | cpython-ac76074628b0a3aea78cc85c79034bb7d04b68f4.zip cpython-ac76074628b0a3aea78cc85c79034bb7d04b68f4.tar.gz cpython-ac76074628b0a3aea78cc85c79034bb7d04b68f4.tar.bz2 |
Merged revisions 81753 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81753 | michael.foord | 2010-06-05 14:48:27 +0100 (Sat, 05 Jun 2010) | 1 line
Fix unittest tests after previous commit.
........
Diffstat (limited to 'Lib/unittest/test')
-rw-r--r-- | Lib/unittest/test/test_case.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/unittest/test/test_case.py b/Lib/unittest/test/test_case.py index 7de7931..8345443 100644 --- a/Lib/unittest/test/test_case.py +++ b/Lib/unittest/test/test_case.py @@ -776,7 +776,7 @@ test case A test case is the smallest unit of testing. [...] You may provide your own implementation that does not subclass from TestCase, of course. """ - sample_text_error = """ + sample_text_error = """\ - http://www.python.org/doc/2.3/lib/module-unittest.html ? ^ + http://www.python.org/doc/2.4.1/lib/module-unittest.html @@ -787,13 +787,16 @@ test case ? +++++++++++++++++++++ + own implementation that does not subclass from TestCase, of course. """ - + self.maxDiff = None try: self.assertMultiLineEqual(sample_text, revised_sample_text) except self.failureException as e: + # need to remove the first line of the error message + error = str(e).split('\n', 1)[1] + # no fair testing ourself with ourself, and assertEqual is used for strings # so can't use assertEqual either. Just use assertTrue. - self.assertTrue(sample_text_error == str(e)) + self.assertTrue(sample_text_error == error) def testAssertIsNone(self): self.assertIsNone(None) |