import unittest
import paramunittest
import readExcel
import urllib.parse
login_xls = readExcel.readExcel().get_xls('case.xls', 'login')
@paramunittest.parametrized(*login_xls)
class testUserLogin(unittest.TestCase):
def setParameters(self, case_name, url, data, method):
"""
set params
:param case_name:
:param path
:param query
:param method
:return:
"""
self.case_name = str(case_name)
self.method = str(method)
self.url = str(url)
self.data = str(data)
print (data)
def description(self):
"""
test report description
:return:
"""
self.case_name
def setUp(self):
"""
:return:
"""
print(self.case_name + "测试开始前准备")
Python使用xlrd读取excel测试用例通过paramunittest参数化(二)
于 2022-02-11 18:03:53 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)