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' #企业编号
加上引号,运行正常了
本文来自博客园,作者:他还在坚持嘛,转载请注明原文链接:他还在坚持嘛 https://www.cnblogs.com/brf-test/p/16697090.html