1. ResourceWarning信息
用例执行成功,但是提示:
ResourceWarning: unclosed <ssl.SSLSocket fd=312, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('x.x.x.x', 52978), raddr=('x.x.x.x', 443)>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
2. 解决
import warnings
def setUp(self):
warnings.simplefilter('ignore', ResourceWarning)
网友评论