Kaydet (Commit) d7b6ad4b authored tarafından Johannes Gijsbers's avatar Johannes Gijsbers

Patch #1061904 / bug #878275: give a nicer error message when someone

accidentally derives from TestSuite instead of TestCase.
üst c1d6536d
......@@ -489,6 +489,8 @@ class TestLoader:
def loadTestsFromTestCase(self, 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)
if not testCaseNames and hasattr(testCaseClass, 'runTest'):
testCaseNames = ['runTest']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment