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) 

 

 


相关文章:

  • 2021-09-14
  • 2021-05-21
  • 2021-06-04
  • 2021-09-01
  • 2021-08-27
  • 2022-02-11
  • 2022-12-23
  • 2022-01-22
猜你喜欢
  • 2021-06-06
  • 2021-12-20
  • 2022-12-23
  • 2021-05-09
  • 2022-01-07
  • 2021-08-15
  • 2022-12-23
相关资源
相似解决方案