读取yaml文件

读取yaml文件内容
import yaml
with open('../data/data.yaml', 'r', encoding='utf-8') as f:
data = yaml.safe_load(f)
print(data)
yaml文件内容
- baseInfo:
api_name: 用户登录
url: /dar/user/login
method: post
header:
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
testcase:
case_name: 用户正常登录校验
data:
user_name: test01
passwd: admin123

posted @ 2024-04-27 20:55  破洞-布衣  阅读(12)  评论(0)    收藏  举报