Kaydet (Commit) b5d7400e authored tarafından R. David Murray's avatar R. David Murray

Change error report when the object passed to suite.addTest is not

callable to include the repr of the invalid object.
üst 11fab6c0
......@@ -43,7 +43,7 @@ class TestSuite(object):
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 "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment