def test_suiteClass__loadTestsFromModule(self):
m = types.ModuleType('m')
class Foo(unittest2.TestCase):
def test_1(self): pass
def test_2(self): pass
def foo_bar(self): pass
m.Foo = Foo
tests = [[Foo('test_1'), Foo('test_2')]]
loader = unittest2.TestLoader()
loader.suiteClass = list
self.assertEqual(loader.loadTestsFromModule(m), tests)
# It is implicit in the documentation for TestLoader.suiteClass that
# all TestLoader.loadTestsFrom* methods respect it. Let's make sure
test_loader.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录