test_loader.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:devsecops-example-helloworld 作者: boozallen 项目源码 文件源码
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"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号