Page MenuHomePhabricator

Unexpected ResourceWarning in namespace_tests.TestNamespaceDictDeprecated
Closed, ResolvedPublic

Description

https://travis-ci.org/wikimedia/pywikibot/jobs/329427210#L4794

======================================================================
FAIL: test_lookup_name (tests.namespace_tests.TestNamespaceDictDeprecated)
Test Namespace.lookup_name.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/wikimedia/pywikibot/tests/namespace_tests.py", line 319, in test_lookup_name
    self.assertIsInstance(file_ns, Namespace)
  File "/home/travis/build/wikimedia/pywikibot/tests/aspects.py", line 1193, in inner_assert
    self.after_assert(assertion, *args, **kwargs)
  File "/home/travis/build/wikimedia/pywikibot/tests/aspects.py", line 1735, in after_assert
    self.assertOneDeprecation()
  File "/home/travis/build/wikimedia/pywikibot/tests/aspects.py", line 1674, in assertOneDeprecation
    self.assertDeprecation(msg)
  File "/home/travis/build/wikimedia/pywikibot/tests/aspects.py", line 1661, in assertDeprecation
    self.assertDeprecationFile(self.expect_warning_filename)
  File "/home/travis/build/wikimedia/pywikibot/tests/aspects.py", line 1704, in assertDeprecationFile
    % (filename, item))
AssertionError: expected warning filename /home/travis/build/wikimedia/pywikibot/tests/namespace_tests.py; warning item: {message : ResourceWarning("unclosed <socket.socket fd=20, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('172.17.0.11', 43256), raddr=('195.28.75.37', 443)>",), category : 'ResourceWarning', filename : '/opt/python/3.6.3/lib/python3.6/inspect.py', lineno : 684, line : None}
----------------------------------------------------------------------

Revisions and Commits

Event Timeline

We also recently had another ResourceWarning in cookiejar.py:

https://travis-ci.org/wikimedia/pywikibot/jobs/329129077#L4352

________________ TestDeprecatedDataSiteMethods.test_get_aliases ________________
self = <tests.wikibase_tests.TestDeprecatedDataSiteMethods testMethod=test_get_aliases>
    def test_get_aliases(self):
        """Test get_aliases."""
        data = self.repo.get_aliases(60)
>       self.assertOneDeprecation()
tests/wikibase_tests.py:1996: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/aspects.py:1674: in assertOneDeprecation
    self.assertDeprecation(msg)
tests/aspects.py:1661: in assertDeprecation
    self.assertDeprecationFile(self.expect_warning_filename)
tests/aspects.py:1704: in assertDeprecationFile
    % (filename, item))
E   AssertionError: expected warning filename /home/travis/build/wikimedia/pywikibot/tests/wikibase_tests.py; warning item: {message : ResourceWarning('unclosed <socket.socket object, fd=17, family=2, type=2049, proto=6>',), category : 'ResourceWarning', filename : '/opt/python/3.3.6/lib/python3.3/http/cookiejar.py', lineno : 1191, line : None}
Dalba triaged this task as High priority.Jan 16 2018, 2:26 PM

Change 404449 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Ignore unclosed socket warnings for py3

https://gerrit.wikimedia.org/r/404449

Change 404449 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Ignore unclosed socket warnings for py3

https://gerrit.wikimedia.org/r/404449