# coding:utf-8
import ddt
import unittest
# 测试数据
test_data1 = [{"username": "zhangsan", "pwd": "zhangsan"},
{"username": "lisi", "pwd": "lisi"},
{"username": "wangwu", "pwd": "wangwu"},
]
test_data2 = [{"username": "wukong", "pwd": "wukong"},
{"username": "wuneng", "pwd": "woneng"},
{"username": "wujing", "pwd": "wujing"},
]
@ddt.ddt
class Test(unittest.TestCase):
def setUp(self):
print("Start!")
def tearDown(self):
print("end!")
@ddt.data(*test_data1)
def test_ddt1(self, data):
print(data)
@ddt.data(*test_data2)
def test_ddt2(self, data):
print(data)
if __name__ == "__main__":
unittest.main()
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步