summaryrefslogtreecommitdiffstats
path: root/Lib/unittest
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2009-09-13 17:28:35 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2009-09-13 17:28:35 (GMT)
commit5a9719d62745a8eed14b5084c2bdb16bf5cb8011 (patch)
treee44c845567849c3df63ce14a52362c94759f36eb /Lib/unittest
parentee2df0300933e8a21372baae01ad2cf2e60a0282 (diff)
downloadcpython-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.py4
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))