mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
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. ........
This commit is contained in:
parent
9dad32efe8
commit
ac76074628
2 changed files with 7 additions and 4 deletions
|
@ -936,7 +936,7 @@ class TestCase(object):
|
||||||
'Second argument is not a string'))
|
'Second argument is not a string'))
|
||||||
|
|
||||||
if first != second:
|
if first != second:
|
||||||
standardMsg = '%s != %s' % (safe_repr(d1, True), safe_repr(d2, True))
|
standardMsg = '%s != %s' % (safe_repr(first, True), safe_repr(second, True))
|
||||||
diff = '\n' + ''.join(difflib.ndiff(first.splitlines(True),
|
diff = '\n' + ''.join(difflib.ndiff(first.splitlines(True),
|
||||||
second.splitlines(True)))
|
second.splitlines(True)))
|
||||||
standardMsg = self._truncateMessage(standardMsg, diff)
|
standardMsg = self._truncateMessage(standardMsg, diff)
|
||||||
|
|
|
@ -776,7 +776,7 @@ test case
|
||||||
A test case is the smallest unit of testing. [...] You may provide your
|
A test case is the smallest unit of testing. [...] You may provide your
|
||||||
own implementation that does not subclass from TestCase, of course.
|
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.3/lib/module-unittest.html
|
||||||
? ^
|
? ^
|
||||||
+ http://www.python.org/doc/2.4.1/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.
|
+ own implementation that does not subclass from TestCase, of course.
|
||||||
"""
|
"""
|
||||||
|
self.maxDiff = None
|
||||||
try:
|
try:
|
||||||
self.assertMultiLineEqual(sample_text, revised_sample_text)
|
self.assertMultiLineEqual(sample_text, revised_sample_text)
|
||||||
except self.failureException as e:
|
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
|
# no fair testing ourself with ourself, and assertEqual is used for strings
|
||||||
# so can't use assertEqual either. Just use assertTrue.
|
# 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):
|
def testAssertIsNone(self):
|
||||||
self.assertIsNone(None)
|
self.assertIsNone(None)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue