Commit d2ff6208 by 文鑫

修改data

parent bd60a0d0
No preview for this file type
...@@ -11,20 +11,20 @@ from common.getData import DoExcelByPandas ...@@ -11,20 +11,20 @@ from common.getData import DoExcelByPandas
class TestSystem(): class TestSystem():
parametrize = DoExcelByPandas().get_data_for_pytest('./data/data.xlsx', 'Sheet1') parametrize = DoExcelByPandas().get_data_for_pytest('./data/data.xlsx', 'Sheet1')
# data = DoExcelByPandas.get_data_for_allure('./data/data.xlsx','Sheet1') # data = DoExcelByPandas.get_data_for_allure('./data/data.xlsx','Sheet1')
def setup_class(self): # def setup_class(self):
print("setup_function:在用例执行前执行") # print("setup_function:在用例执行前执行")
def teardown_class(self): # def teardown_class(self):
print("teardown_function:在用例执行后执行") # print("teardown_function:在用例执行后执行")
@allure.title('{story}') @allure.title('{story}')
@pytest.mark.parametrize('id,url,data,story,method,severity,condition,except_result',parametrize) @pytest.mark.parametrize('id,url,data,story,method,severity,condition,except_result',parametrize)
def test(self,id,url,data,story,method,severity,condition,except_result): # test开头的测试函数 def test(self,id,url,data,story,method,severity,condition,except_result): # test开头的测试函数
print('正在执行',story) # print('正在执行',story)
headers = getHeader.get_Header() # headers = getHeader.get_Header()
url = url url = url
json = eval(data)
if method == 'post': if method == 'post':
r = requests.post(url = url,json = json,headers = headers) json = eval(data)
r = requests.post(url = url,json = json)
else: else:
r = requests.get(url=url) r = requests.get(url=url)
response = r.json() response = r.json()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment