diff --git a/tests/pytest/functions/function_first.py b/tests/pytest/functions/function_first.py index c1f7692dfdfd4dbd29f2873aa607dcb4a7dc1c8b..6c3a747febae03ab90ef8275abbf84283cc07d95 100644 --- a/tests/pytest/functions/function_first.py +++ b/tests/pytest/functions/function_first.py @@ -17,6 +17,7 @@ from util.log import * from util.cases import * from util.sql import * import numpy as np +import re class TDTestCase: @@ -152,7 +153,7 @@ class TDTestCase: r = os.popen("taos -s 'select first(c1) + last(c1) from test.tb01'") text = r.read() r.close() - result = float(text.split("|")[1].split("\n")[2]) + result = float(re.split('\n |\|', text)[3]) tdSql.query("select first(c1) + last(c1) from tb01") tdSql.checkData(0, 0, result) @@ -160,8 +161,8 @@ class TDTestCase: r = os.popen("taos -s 'select first(c1) - last(c1) from test.tb01'") text = r.read() r.close() - result = float(text.split("|")[1].split("\n")[2]) - tdSql.query("select first(c1) - last(c1) from tb01") + result = float(re.split('\n |\|', text)[3]) + tdSql.query("select first(c1) + last(c1) from tb01") tdSql.checkData(0, 0, result)