[Python-checkins] r77825 - in python/branches/py3k: Lib/unittest/suite.py

r.david.murray python-checkins at python.org
Fri Jan 29 18:55:47 CET 2010


Author: r.david.murray
Date: Fri Jan 29 18:55:47 2010
New Revision: 77825

Log:
Merged revisions 77815 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77815 | r.david.murray | 2010-01-28 16:16:33 -0500 (Thu, 28 Jan 2010) | 3 lines
  
  Change error report when the object passed to suite.addTest is not
  callable to include the repr of the invalid object.
........


Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Lib/unittest/suite.py

Modified: python/branches/py3k/Lib/unittest/suite.py
==============================================================================
--- python/branches/py3k/Lib/unittest/suite.py	(original)
+++ python/branches/py3k/Lib/unittest/suite.py	Fri Jan 29 18:55:47 2010
@@ -40,7 +40,7 @@
     def addTest(self, test):
         # sanity checks
         if not hasattr(test, '__call__'):
-            raise TypeError("the test to add must be callable")
+            raise TypeError("{} is not callable".format(repr(test)))
         if isinstance(test, type) and issubclass(test,
                                                  (case.TestCase, TestSuite)):
             raise TypeError("TestCases and TestSuites must be instantiated "


More information about the Python-checkins mailing list