summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2010-06-05 13:48:27 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2010-06-05 13:48:27 (GMT)
commitf2c25c5cb0225c8c4ffeff34ae72f4cd2b6fe102 (patch)
treef5c67315663aabcdccb64d4e8c6f92ff5568f777 /Lib/unittest/test
parent5fe21ff91a0f3404680a7ff8c3c78b085b7ce92a (diff)
downloadcpython-f2c25c5cb0225c8c4ffeff34ae72f4cd2b6fe102.zip
cpython-f2c25c5cb0225c8c4ffeff34ae72f4cd2b6fe102.tar.gz
cpython-f2c25c5cb0225c8c4ffeff34ae72f4cd2b6fe102.tar.bz2
Fix unittest tests after previous commit.
Diffstat (limited to 'Lib/unittest/test')
-rw-r--r--Lib/unittest/test/test_case.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/unittest/test/test_case.py b/Lib/unittest/test/test_case.py
index 840defd..92ede20 100644
--- a/Lib/unittest/test/test_case.py
+++ b/Lib/unittest/test/test_case.py
@@ -807,7 +807,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 = b"""
+ sample_text_error = b"""\
- http://www.python.org/doc/2.3/lib/module-unittest.html
? ^
+ http://www.python.org/doc/2.4.1/lib/module-unittest.html
@@ -818,15 +818,18 @@ test case
? +++++++++++++++++++++
+ own implementation that does not subclass from TestCase, of course.
"""
-
+ self.maxDiff = None
for type_changer in (lambda x: x, lambda x: x.decode('utf8')):
try:
self.assertMultiLineEqual(type_changer(sample_text),
type_changer(revised_sample_text))
except self.failureException, e:
+ # need to remove the first line of the error message
+ error = str(e).encode('utf8').split('\n', 1)[1]
+
# assertMultiLineEqual is hooked up as the default for
# unicode strings - so we can't use it for this check
- self.assertTrue(sample_text_error == str(e).encode('utf8'))
+ self.assertTrue(sample_text_error == error)
def testAssertIsNone(self):
self.assertIsNone(None)