Commit d2ff6208 by 文鑫

修改data

parent bd60a0d0
No preview for this file type
......@@ -11,20 +11,20 @@ from common.getData import DoExcelByPandas
class TestSystem():
parametrize = DoExcelByPandas().get_data_for_pytest('./data/data.xlsx', 'Sheet1')
# data = DoExcelByPandas.get_data_for_allure('./data/data.xlsx','Sheet1')
def setup_class(self):
print("setup_function:在用例执行前执行")
# def setup_class(self):
# print("setup_function:在用例执行前执行")
def teardown_class(self):
print("teardown_function:在用例执行后执行")
# def teardown_class(self):
# print("teardown_function:在用例执行后执行")
@allure.title('{story}')
@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开头的测试函数
print('正在执行',story)
headers = getHeader.get_Header()
# print('正在执行',story)
# headers = getHeader.get_Header()
url = url
json = eval(data)
if method == 'post':
r = requests.post(url = url,json = json,headers = headers)
json = eval(data)
r = requests.post(url = url,json = json)
else:
r = requests.get(url=url)
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