]> granicus.if.org Git - python/commitdiff
Merged revisions 87377 via svnmerge from
authorEzio Melotti <ezio.melotti@gmail.com>
Sat, 18 Dec 2010 17:58:29 +0000 (17:58 +0000)
committerEzio Melotti <ezio.melotti@gmail.com>
Sat, 18 Dec 2010 17:58:29 +0000 (17:58 +0000)
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.
........

Lib/unittest/case.py
Lib/unittest/test/test_assertions.py

index 6e7dd24e68760146334d130c9e9c6a888db53d6c..3940daa4c4e7cf37a77c27f91da07d9f1c83091c 100644 (file)
@@ -393,15 +393,15 @@ class TestCase(object):
         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):
index 1e40789b8579ef01ceccc671f1a6ce06c45afb53..e85ca915c311b47dce6c2ccc8fc85e4462d5ad26 100644 (file)
@@ -165,13 +165,13 @@ class TestLongMessage(unittest.TestCase):
 
     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),