美文网首页测试
Python3 使用unittest时,没有报错,但提示:Res

Python3 使用unittest时,没有报错,但提示:Res

作者: Agony_锐 | 来源:发表于2020-09-16 20:31 被阅读0次

    解决方法:

      在报警告的文件头里导入warnings模块,然后调用忽略warnings函数
    
    import warnings
    
    def XXX(self):
         warnings.simplefilter('ignore', ResourceWarning)
    

    相关文章

      网友评论

        本文标题:Python3 使用unittest时,没有报错,但提示:Res

        本文链接:https://www.haomeiwen.com/subject/ujihyktx.html