mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Merged revisions 78130 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r78130 | michael.foord | 2010-02-10 14:25:12 +0000 (Wed, 10 Feb 2010) | 1 line Issue 7893 and Issue 7588 ........
This commit is contained in:
parent
99f69ee7a1
commit
34c9462d71
7 changed files with 107 additions and 46 deletions
|
@ -229,18 +229,15 @@ class TestCase(object):
|
|||
return result.TestResult()
|
||||
|
||||
def shortDescription(self):
|
||||
"""Returns both the test method name and first line of its docstring.
|
||||
"""Returns a one-line description of the test, or None if no
|
||||
description has been provided.
|
||||
|
||||
If no docstring is given, only returns the method name.
|
||||
The default implementation of this method returns the first line of
|
||||
the specified test method's docstring.
|
||||
"""
|
||||
desc = str(self)
|
||||
doc_first_line = None
|
||||
doc = self._testMethodDoc
|
||||
return doc and doc.split("\n")[0].strip() or None
|
||||
|
||||
if self._testMethodDoc:
|
||||
doc_first_line = self._testMethodDoc.split("\n")[0].strip()
|
||||
if doc_first_line:
|
||||
desc = '\n'.join((desc, doc_first_line))
|
||||
return desc
|
||||
|
||||
def id(self):
|
||||
return "%s.%s" % (util.strclass(self.__class__), self._testMethodName)
|
||||
|
@ -501,7 +498,6 @@ class TestCase(object):
|
|||
assertNotEquals = assertNotEqual
|
||||
assertAlmostEquals = assertAlmostEqual
|
||||
assertNotAlmostEquals = assertNotAlmostEqual
|
||||
assert_ = assertTrue
|
||||
|
||||
# These fail* assertion method names are pending deprecation and will
|
||||
# be a DeprecationWarning in 3.2; http://bugs.python.org/issue2578
|
||||
|
@ -518,6 +514,7 @@ class TestCase(object):
|
|||
failUnlessAlmostEqual = _deprecate(assertAlmostEqual)
|
||||
failIfAlmostEqual = _deprecate(assertNotAlmostEqual)
|
||||
failUnless = _deprecate(assertTrue)
|
||||
assert_ = _deprecate(assertTrue)
|
||||
failUnlessRaises = _deprecate(assertRaises)
|
||||
failIf = _deprecate(assertFalse)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue