diff options
author | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-05-08 17:06:25 (GMT) |
---|---|---|
committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-05-08 17:06:25 (GMT) |
commit | 9c164af6c35cc0a0b21162d74bd7ea572731ed2c (patch) | |
tree | 6ce4a91fc6328b49b45151eca1fbbedd404dfc4d /Lib/unittest/suite.py | |
parent | 7daf0e4aa13b98d5217dc49e5f87e7a4007aee33 (diff) | |
download | cpython-9c164af6c35cc0a0b21162d74bd7ea572731ed2c.zip cpython-9c164af6c35cc0a0b21162d74bd7ea572731ed2c.tar.gz cpython-9c164af6c35cc0a0b21162d74bd7ea572731ed2c.tar.bz2 |
unittest: issue 8301. Adding functions to test suites no longer crashes.
Diffstat (limited to 'Lib/unittest/suite.py')
-rw-r--r-- | Lib/unittest/suite.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/unittest/suite.py b/Lib/unittest/suite.py index 0dd2dc5..cf6d94a 100644 --- a/Lib/unittest/suite.py +++ b/Lib/unittest/suite.py @@ -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: |