diff options
author | Michael Foord <fuzzyman@voidspace.org.uk> | 2009-09-13 17:28:35 (GMT) |
---|---|---|
committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2009-09-13 17:28:35 (GMT) |
commit | 5a9719d62745a8eed14b5084c2bdb16bf5cb8011 (patch) | |
tree | e44c845567849c3df63ce14a52362c94759f36eb /Lib/unittest | |
parent | ee2df0300933e8a21372baae01ad2cf2e60a0282 (diff) | |
download | cpython-5a9719d62745a8eed14b5084c2bdb16bf5cb8011.zip cpython-5a9719d62745a8eed14b5084c2bdb16bf5cb8011.tar.gz cpython-5a9719d62745a8eed14b5084c2bdb16bf5cb8011.tar.bz2 |
unittest.TestLoader.loadTestsFromName honors the loader suiteClass attribute. Issue 6866.
Diffstat (limited to 'Lib/unittest')
-rw-r--r-- | Lib/unittest/loader.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/unittest/loader.py b/Lib/unittest/loader.py index 21c7ed0..21520f5 100644 --- a/Lib/unittest/loader.py +++ b/Lib/unittest/loader.py @@ -85,7 +85,7 @@ class TestLoader(object): elif (isinstance(obj, types.UnboundMethodType) and isinstance(parent, type) and issubclass(parent, case.TestCase)): - return suite.TestSuite([parent(obj.__name__)]) + return self.suiteClass([parent(obj.__name__)]) elif isinstance(obj, suite.TestSuite): return obj elif hasattr(obj, '__call__'): @@ -93,7 +93,7 @@ class TestLoader(object): if isinstance(test, suite.TestSuite): return test elif isinstance(test, case.TestCase): - return suite.TestSuite([test]) + return self.suiteClass([test]) else: raise TypeError("calling %s returned %s, not a test" % (obj, test)) |