ResourceWarning unclosed socket in Python 3 Unit Test

后端 未结 2 1118
再見小時候
再見小時候 2021-02-05 00:17

I\'m modifying some code to be compatible between Python 2 and Python 3, but have observed a warning in unit test output.

/Library/Fram         


        
2条回答
  •  执笔经年
    2021-02-05 01:07

    This is the best solution if you are not much concern about warnings

    Just import warnings and add this line where your driver is initiating -

    import warnings
    
    warnings.filterwarnings(action="ignore", message="unclosed", category=ResourceWarning)
    

提交回复
热议问题