update tools/data_process.py.

sql栏支持多sql语句执行(查询),多条sql之间使用英文 ; 结尾
This commit is contained in:
zy7y 2021-05-17 16:14:20 +08:00 committed by Gitee
parent e61b512983
commit 4a5b6f807b
1 changed files with 13 additions and 8 deletions

View File

@ -87,6 +87,11 @@ class DataProcess:
allure_step('运行sql', sql)
logger.info(sql)
if sql is not None:
# 多条sql在用例中填写方式如下select * from user; select * from goods 每条sql语句之间需要使用 ; 来分割
for sql in sql.split(";"):
sql = sql.strip()
if sql == '':
continue
# 查后置sql
result = db.fetch_one(sql)
allure_step('sql执行结果', result)