mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
accidentally derives from TestSuite instead of TestCase.
This commit is contained in:
parent
c1d6536d60
commit
d7b6ad4b60
1 changed files with 2 additions and 0 deletions
|
@ -489,6 +489,8 @@ class TestLoader:
|
||||||
|
|
||||||
def loadTestsFromTestCase(self, testCaseClass):
|
def loadTestsFromTestCase(self, testCaseClass):
|
||||||
"""Return a suite of all tests cases contained in testCaseClass"""
|
"""Return a suite of all tests cases contained in testCaseClass"""
|
||||||
|
if issubclass(testCaseClass, TestSuite):
|
||||||
|
raise TypeError("Test cases should not be derived from TestSuite. Maybe you meant to derive from TestCase?")
|
||||||
testCaseNames = self.getTestCaseNames(testCaseClass)
|
testCaseNames = self.getTestCaseNames(testCaseClass)
|
||||||
if not testCaseNames and hasattr(testCaseClass, 'runTest'):
|
if not testCaseNames and hasattr(testCaseClass, 'runTest'):
|
||||||
testCaseNames = ['runTest']
|
testCaseNames = ['runTest']
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue