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)