1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | import sys import os base_path = os.getcwd() sys.path.append(base_path) base_path = os.path.dirname(base_path) print (base_path) import ddt import unittest from imoocInterface.Util.handle_excel import excel_data data = excel_data.get_excel_data() #data1=[[1,2,3,4,5],[2,3,4,5,6],[3,4,5,6,7]] @ddt .ddt class TestCase01(unittest.TestCase): def setUp( self ): print ( "case开始执行" ) def tearDown( self ): print ( "case执行结束" ) @ddt.data( * data) def test_01( self ,data): #case编号 作用 是否执行 前置条件 依赖的key url method data cookie操作 header操作 预期结果方式 预期结果 result 数据 case_id, function, is_run, condition, depend_key, url, method, request_data, cookie, header, execpet_method, execpet, result, result_data = data print (case_id,function,is_run,condition,depend_key,url,method,request_data,cookie,header,execpet_method,execpet,result,result_data) if __name__ = = '__main__' : unittest.main() |
看了一下 数据传的数量是对的,为啥还报错啊