def test_loadTestsFromTestCase__default_method_name(self):
class Foo(unittest2.TestCase):
def runTest(self):
pass
loader = unittest2.TestLoader()
# This has to be false for the test to succeed
self.assertFalse('runTest'.startswith(loader.testMethodPrefix))
suite = loader.loadTestsFromTestCase(Foo)
self.assertIsInstance(suite, loader.suiteClass)
self.assertEqual(list(suite), [Foo('runTest')])
################################################################
### /Tests for TestLoader.loadTestsFromTestCase
### Tests for TestLoader.loadTestsFromModule
################################################################
# "This method searches `module` for classes derived from TestCase"
test_loader.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录