- 博客(1)
- 收藏
- 关注
原创 unittest 警告ResourceWarning
unittest 警告ResourceWarningid = yaml.safe_load(open('./docs/test.yml', 'r'))警告ResourceWarning一般是因为文件没有被正确关闭,上述代码可修改为file = open('./docs/test.yml', 'r')id = yaml.safe_load(file)~~~~~~~~file.close()或使用with openwith open ('./docs/test.yml', 'r') id
2021-04-08 22:33:53 212
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人