def test_loadTestsFromTestCase__TestSuite_subclass(self):
class NotATestCase(unittest2.TestSuite):
pass
loader = unittest2.TestLoader()
try:
loader.loadTestsFromTestCase(NotATestCase)
except TypeError:
pass
else:
self.fail('Should raise TypeError')
# "Return a suite of all tests cases contained in the TestCase-derived
# class testCaseClass"
#
# Make sure loadTestsFromTestCase() picks up the default test method
# name (as specified by TestCase), even though the method name does
# not match the default TestLoader.testMethodPrefix string
test_loader.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录