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
........
diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py
index cf180d7..cd0764d 100644
--- a/Lib/unittest/case.py
+++ b/Lib/unittest/case.py
@@ -229,18 +229,15 @@
         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 @@
     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 @@
     failUnlessAlmostEqual = _deprecate(assertAlmostEqual)
     failIfAlmostEqual = _deprecate(assertNotAlmostEqual)
     failUnless = _deprecate(assertTrue)
+    assert_ = _deprecate(assertTrue)
     failUnlessRaises = _deprecate(assertRaises)
     failIf = _deprecate(assertFalse)