首页 > 其他 > 详细

unittest requests 错误 ResourceWarning: Enable tracemalloc to get the object allocation traceback

时间:2021-05-15 00:42:50      阅读:685      评论:0      收藏:0      [点我收藏+]
unittest  使用 requests 发请求 遇到如下错误:  
ResourceWarning: Enable tracemalloc to get the object allocation traceback



代码中添加以下红色代码即可.

1 import warnings
2 
3     def setUp(self):
4         # 解决错误 ResourceWarning: Enable tracemalloc to get the object allocation traceback
5         warnings.simplefilter(‘ignore‘,ResourceWarning) 

 

 


unittest requests 错误 ResourceWarning: Enable tracemalloc to get the object allocation traceback

原文:https://www.cnblogs.com/levia/p/14770349.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!