Commit ffe0b706 by 文鑫

修改用例路劲

parent 5dc2aa37
...@@ -4,12 +4,14 @@ _date_ = '2020/6/11 11:03' ...@@ -4,12 +4,14 @@ _date_ = '2020/6/11 11:03'
import requests import requests
import allure import allure
import pytest import pytest
import sys
sys.path.append('../')
from common import getSourceId from common import getSourceId
from common.getData import DoExcelByPandas from common.getData import DoExcelByPandas
@allure.feature('数据源') @allure.feature('数据源')
class TestSystem(): class TestSource():
parametrize = DoExcelByPandas().get_data_for_pytest('./data/data.xlsx', 'Sheet1') parametrize = DoExcelByPandas().get_data_for_pytest('../data/DataA_Source.xlsx', 'Sheet1')
@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开头的测试函数
...@@ -38,6 +40,6 @@ class TestSystem(): ...@@ -38,6 +40,6 @@ class TestSystem():
if __name__ == '__main__': if __name__ == '__main__':
pytest.main(['-s','test_DataA.py']) #-s参数是为了显示用例的打印信息。 -q参数只显示结果,不显示过程 pytest.main(['-s','test_Source.py']) #-s参数是为了显示用例的打印信息。 -q参数只显示结果,不显示过程
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