jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/400228 )
Change subject: [bugfix] Ignore unclosed socket warnings ......................................................................
[bugfix] Ignore unclosed socket warnings
- Ignore unclosed socket warnings in for py3
Bug: T183696 Change-Id: I27c46c98d1ccedf8726ed11d881316dbcb616bba --- M tests/utils.py 1 file changed, 9 insertions(+), 0 deletions(-)
Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/utils.py b/tests/utils.py index 4350448..5235917 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -27,6 +27,8 @@
if not PY2: import six +else: + ResourceWarning = None # flake8: F821
import pywikibot
@@ -255,6 +257,13 @@ else: skip_frames -= 1
+ # Ignore socket IO warnings (T183696) + if (PYTHON_VERSION >= (3, 2) + and issubclass(warn_msg.category, ResourceWarning) + and 'unclosed <socket.socket' in str(warn_msg.message) + and warn_msg.filename.endswith('socket.py')): + return + log.append(warn_msg)
log = super(WarningSourceSkipContextManager, self).__enter__()