]> granicus.if.org Git - python/commitdiff
Ensure the actual number matches the expected count
authorNeal Norwitz <nnorwitz@gmail.com>
Fri, 28 Jul 2006 04:22:34 +0000 (04:22 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Fri, 28 Jul 2006 04:22:34 +0000 (04:22 +0000)
Lib/test/test_inspect.py

index 928af07c41d694bc4b3e2c2e7d7ec7614bfcfe3a..300de1416b9d521b8a753e1a8bee767eafc5456a 100644 (file)
@@ -43,10 +43,11 @@ class IsTestBase(unittest.TestCase):
 
 class TestPredicates(IsTestBase):
     def test_thirteen(self):
-        # Doc/lib/libinspect.tex claims there are 13 such functions
         count = len(filter(lambda x:x.startswith('is'), dir(inspect)))
-        self.assertEqual(count, 13,
-                         "There are %d (not 12) is* functions" % count)
+        # Doc/lib/libinspect.tex claims there are 13 such functions
+        expected = 13
+        err_msg = "There are %d (not %d) is* functions" % (count, expected)
+        self.assertEqual(count, expected, err_msg)
 
     def test_excluding_predicates(self):
         self.istest(inspect.isbuiltin, 'sys.exit')