首页 > 其他分享> > unittest requests 错误 ResourceWarning: Enable tracemalloc to get the object allocation traceback
unittest requests 错误 ResourceWarning: Enable tracemalloc to get the object allocation traceback
作者:互联网
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)
标签:tracemalloc,Enable,get,object,allocation,ResourceWarning 来源: https://www.cnblogs.com/levia/p/14770349.html