每条用例执行10次

每条用例执行10次

https://blog.csdn.net/weixin_40656303/article/details/109893244

# -*- coding:utf-8 -*-

import unittest

class SetupEndDef(unittest.TestCase):
    """初始化方法"""
    def setUp(self):
        pass

    def tearDown(self):
        pass

class S(SetupEndDef):
    """ 1"""
    def test_01(self):
        print(1+1)
    def test_02(self):
        print(1+3)
if __name__ == '__main__':
    suit = unittest.TestSuite()  # 用例集
    for i in range(10):
        suit.addTest(S('test_01'))  # 类名字+方法名字(用例test开头)
    runner = unittest.TextTestRunner()  # 全部运行
    runner.run(suit)

 

 

posted @ 2021-04-19 21:26  测试艺术家  阅读(85)  评论(0编辑  收藏  举报