python unitest +ddt参数化【方法二】
方法1: import unittest import ddt datas=[{"user": "admin", "psw": "123456", "result": "true"}, {"user": "admin_001", "psw": "123456", "result": "true"}, {"user": "admin_002", "psw": "123456", "result": "true"}, {"user": "admin_003", "psw": "123456", "result": "true"}, {"user": "admin_004", "psw": "123456", "result": "true"},] @ddt.ddt class Test(unittest.TestCase): # @ddt.data(*datas) @ddt.data(*datas) def test_(self,d):
共有 0 条评论