【unittest】-【warnning】-Warning报警问题的解决思路

Warning报警问题的解决思路
D:python36libunittestcase.py:605: ResourceWarning: unclosed file <_io.BufferedReader name='C:Usersqm66DesktopRefresh.dgs'>
** testMethod()**

解决办法,可以通过warnings库来忽略掉相关告警。

import warnings
warnings.simplefilter("ignore", ResourceWarning)
原文地址:https://www.cnblogs.com/ludundun/p/13100922.html