每天努力一点点,坚持下去 ------ 博客首页

yaml中的坑:AttributeError: 'int' object has no attribute 'encode'

今天在执行yaml中,报错了:

AttributeError: 'int' object has no attribute 'encode'

data.yaml

interface: /api/import
test_cases:
 case-01-全部字段齐全:
  code: 200
  body:
   file: 'D:\Pycharm\netOrderTest.xls' #导入excel
   entCertNo: 9144031234439400 #企业编号

然后发现是yaml中【entCertNo】的值没有加引号,是整数类型,更改为

interface: /api/import
test_cases:
 case-01-全部字段齐全:
  code: 200
  body:
   file: 'D:\Pycharm\netOrderTest.xls' #导入excel
   entCertNo: '9144031234439400' #企业编号

加上引号,运行正常了


 

posted @ 2022-09-15 16:43  他还在坚持嘛  阅读(270)  评论(0编辑  收藏  举报