test_loader.py 文件源码

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

项目:devsecops-example-helloworld 作者: boozallen 项目源码 文件源码
def test_loadTestsFromTestCase__no_matches(self):
        class Foo(unittest2.TestCase):
            def foo_bar(self): pass

        empty_suite = unittest2.TestSuite()

        loader = unittest2.TestLoader()
        self.assertEqual(loader.loadTestsFromTestCase(Foo), empty_suite)

    # "Return a suite of all tests cases contained in the TestCase-derived
    # class testCaseClass"
    #
    # What happens if loadTestsFromTestCase() is given an object
    # that isn't a subclass of TestCase? Specifically, what happens
    # if testCaseClass is a subclass of TestSuite?
    #
    # This is checked for specifically in the code, so we better add a
    # test for it.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号