test_loader.py 文件源码

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

项目:devsecops-example-helloworld 作者: boozallen 项目源码 文件源码
def test_getTestCaseNames__not_a_TestCase(self):
        class BadCase(int):
            def test_foo(self):
                pass

        loader = unittest2.TestLoader()
        names = loader.getTestCaseNames(BadCase)

        self.assertEqual(names, ['test_foo'])

    # "Return a sorted sequence of method names found within testCaseClass"
    #
    # Make sure inherited names are handled.
    #
    # TestP.foobar is defined to make sure getTestCaseNames() respects
    # loader.testMethodPrefix
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号