forked from DxvLwRYF/apiAutoTest
update tools/data_process.py.
sql栏支持多sql语句执行(查询),多条sql之间使用英文 ; 结尾
This commit is contained in:
parent
e61b512983
commit
4a5b6f807b
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue