增加缓存使用方式
This commit is contained in:
parent
b966cc51d3
commit
e0a8629ea1
1
run.py
1
run.py
|
@ -57,6 +57,7 @@ if __name__ == '__main__':
|
|||
'-p', 'no:sugar', # 禁用pytest-sugar美化控制台结果
|
||||
# '-k not test_login.py', # 不执行该文件里的case
|
||||
# '-m smoke', # 只运行mark标记为smoke的测试用例
|
||||
'-W', 'ignore:Module already imported so cannot be rewritten'
|
||||
])
|
||||
|
||||
# ------------------------------发送allure报告----------------------------------
|
||||
|
|
|
@ -16,7 +16,7 @@ from utils.cache_handle import CacheHandler
|
|||
def get_token():
|
||||
"""获取登录V1的token"""
|
||||
logger.info("开始用例前置操作")
|
||||
# 调登录接口,获取登录接口的token¬
|
||||
# 调登录接口,获取登录接口的token
|
||||
login_response = Login().login('18800000001', '123456')
|
||||
token = BaseApi.get_json(login_response)['data']['token']
|
||||
CacheHandler.set_cache('Authorization', f'Bearer {token}')
|
||||
|
|
Loading…
Reference in New Issue