unittest: issue 8301. Adding functions to test suites no longer crashes.

This commit is contained in:
Michael Foord 2010-05-08 17:06:25 +00:00
parent 7daf0e4aa1
commit 9c164af6c3
2 changed files with 15 additions and 1 deletions

View file

@ -119,7 +119,12 @@ class TestSuite(BaseTestSuite):
if getattr(currentClass, "__unittest_skip__", False):
return
currentClass._classSetupFailed = False
try:
currentClass._classSetupFailed = False
except TypeError:
# test may actually be a function
# so its class will be a builtin-type
pass
setUpClass = getattr(currentClass, 'setUpClass', None)
if setUpClass is not None: