[Python-checkins] r87380 - in python/branches/release27-maint: Lib/unittest/case.py Lib/unittest/test/test_assertions.py

ezio.melotti python-checkins at python.org
Sat Dec 18 18:58:29 CET 2010


Author: ezio.melotti
Date: Sat Dec 18 18:58:29 2010
New Revision: 87380

Log:
Merged revisions 87377 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87377 | ezio.melotti | 2010-12-18 18:31:58 +0100 (Sat, 18 Dec 2010) | 1 line
  
  Use lowercase true/false in assertTrue/assertFalse messages.
........


Modified:
   python/branches/release27-maint/   (props changed)
   python/branches/release27-maint/Lib/unittest/case.py
   python/branches/release27-maint/Lib/unittest/test/test_assertions.py

Modified: python/branches/release27-maint/Lib/unittest/case.py
==============================================================================
--- python/branches/release27-maint/Lib/unittest/case.py	(original)
+++ python/branches/release27-maint/Lib/unittest/case.py	Sat Dec 18 18:58:29 2010
@@ -393,15 +393,15 @@
         raise self.failureException(msg)
 
     def assertFalse(self, expr, msg=None):
-        "Fail the test if the expression is true."
+        """Check that the expression is false."""
         if expr:
-            msg = self._formatMessage(msg, "%s is not False" % safe_repr(expr))
+            msg = self._formatMessage(msg, "%s is not false" % safe_repr(expr))
             raise self.failureException(msg)
 
     def assertTrue(self, expr, msg=None):
-        """Fail the test unless the expression is true."""
+        """Check that the expression is true."""
         if not expr:
-            msg = self._formatMessage(msg, "%s is not True" % safe_repr(expr))
+            msg = self._formatMessage(msg, "%s is not true" % safe_repr(expr))
             raise self.failureException(msg)
 
     def _formatMessage(self, msg, standardMsg):

Modified: python/branches/release27-maint/Lib/unittest/test/test_assertions.py
==============================================================================
--- python/branches/release27-maint/Lib/unittest/test/test_assertions.py	(original)
+++ python/branches/release27-maint/Lib/unittest/test/test_assertions.py	Sat Dec 18 18:58:29 2010
@@ -165,13 +165,13 @@
 
     def testAssertTrue(self):
         self.assertMessages('assertTrue', (False,),
-                            ["^False is not True$", "^oops$", "^False is not True$",
-                             "^False is not True : oops$"])
+                            ["^False is not true$", "^oops$", "^False is not true$",
+                             "^False is not true : oops$"])
 
     def testAssertFalse(self):
         self.assertMessages('assertFalse', (True,),
-                            ["^True is not False$", "^oops$", "^True is not False$",
-                             "^True is not False : oops$"])
+                            ["^True is not false$", "^oops$", "^True is not false$",
+                             "^True is not false : oops$"])
 
     def testNotEqual(self):
         self.assertMessages('assertNotEqual', (1, 1),


More information about the Python-checkins mailing list