mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
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. ........
This commit is contained in:
parent
bc09964be1
commit
67d1bbde3f
1 changed files with 1 additions and 1 deletions
|
@ -40,7 +40,7 @@ class TestSuite(object):
|
||||||
def addTest(self, test):
|
def addTest(self, test):
|
||||||
# sanity checks
|
# sanity checks
|
||||||
if not hasattr(test, '__call__'):
|
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,
|
if isinstance(test, type) and issubclass(test,
|
||||||
(case.TestCase, TestSuite)):
|
(case.TestCase, TestSuite)):
|
||||||
raise TypeError("TestCases and TestSuites must be instantiated "
|
raise TypeError("TestCases and TestSuites must be instantiated "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue