Commit 86f349c5 authored by zhanhuasheng's avatar zhanhuasheng

1、数据库修改地址

2、告警时间调整
parent fad1116c
...@@ -27,13 +27,13 @@ formal_password = 123456789A ...@@ -27,13 +27,13 @@ formal_password = 123456789A
address = 47.251.1.100 address = 47.251.1.100
#端口 #端口
port = 3306 port = 13306
#账号 #账号
account = willdesk account = root
#密码 #密码
password = uitSElgrwLp6vFG password = YKp-gmG28isz5qX
[rerun] [rerun]
rerun = 1 rerun = 1
......
...@@ -2,6 +2,8 @@ import time ...@@ -2,6 +2,8 @@ import time
import jsonpath import jsonpath
import pymysql.err import pymysql.err
import warnings import warnings
import pytest
import requests import requests
import re import re
import os import os
...@@ -141,9 +143,9 @@ class ReqHandler: ...@@ -141,9 +143,9 @@ class ReqHandler:
try: try:
assert res.status_code == 200 #先断言状态码是正确的 assert res.status_code == 200 #先断言状态码是正确的
time = res.elapsed.total_seconds() time = res.elapsed.total_seconds()
if time >= 4: if time >= 5:
warnings.warn(f'接口响应时间过长,耗时{time}秒') warnings.warn(f'接口响应时间过长,耗时{str(time)}秒',RuntimeWarning) #告警接口耗时过长
logger.error(f'接口响应时间过长,耗时{time}秒') logger.error(f'接口响应时间过长,耗时{str(time)}秒')
if isinstance(expected,list): if isinstance(expected,list):
''' '''
穿进来的expected一定是 {"eq":{$.code : value}} 的形式,要断言的值一定是通过jsonpath去检索的 穿进来的expected一定是 {"eq":{$.code : value}} 的形式,要断言的值一定是通过jsonpath去检索的
......
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