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) 
 

 

 



免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM