diff options
author | R. David Murray <rdmurray@bitdance.com> | 2010-01-28 21:16:33 (GMT) |
---|---|---|
committer | R. David Murray <rdmurray@bitdance.com> | 2010-01-28 21:16:33 (GMT) |
commit | b5d7400e8a62ebedb8575cca8cd777e29c230e91 (patch) | |
tree | 651483f6d572e6135577a42e4a2be9629dc2d89b /Lib | |
parent | 11fab6c07dbd40326a59e9d853f5b093e83e3836 (diff) | |
download | cpython-b5d7400e8a62ebedb8575cca8cd777e29c230e91.zip cpython-b5d7400e8a62ebedb8575cca8cd777e29c230e91.tar.gz cpython-b5d7400e8a62ebedb8575cca8cd777e29c230e91.tar.bz2 |
Change error report when the object passed to suite.addTest is not
callable to include the repr of the invalid object.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/unittest/suite.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/unittest/suite.py b/Lib/unittest/suite.py index 730b4d9..60e9b6c 100644 --- a/Lib/unittest/suite.py +++ b/Lib/unittest/suite.py @@ -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 " |