Page MenuHomePhabricator

TestSiteObjectDeprecatedFunctions.test_loadimageinfo fails with Python 3.5
Closed, ResolvedPublic

Description

_____________ TestSiteObjectDeprecatedFunctions.test_loadimageinfo _____________

self = <tests.site_tests.TestSiteObjectDeprecatedFunctions testMethod=test_loadimageinfo>

    def test_loadimageinfo(self):
        """Test deprecation warning if result of loadimageinfo() is used."""
        file = pywikibot.FilePage(self.site, 'foo.jpg')
        if not file.file_is_shared():
            self.skipPage('test file is not shared from image repository.')
        self.site.loadimageinfo(file)
>       self.assertNoDeprecation()

tests/site_tests.py:116: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/aspects.py:1533: in assertNoDeprecation
    self.assertEqual([], self.deprecation_messages)
E   AssertionError: Lists differ: [] != ["APISite.loadimageinfo() result dict and [289 chars]ad."]
E   
E   Second list contains 2 additional elements.
E   First extra element 0:
E   "APISite.loadimageinfo() result dict and any assignment is deprecated for 5 days; use pageitem['imageinfo'] if history is True else pageitem['imageinfo'][0] instead."
E   
E   - []
E   + ['APISite.loadimageinfo() result dict and any assignment is deprecated for 5 '
E   +  "days; use pageitem['imageinfo'] if history is True else "
E   +  "pageitem['imageinfo'][0] instead.",
E   +  'APISite.loadimageinfo() result dict and any assignment is deprecated for 5 '
E   +  "days; use pageitem['imageinfo'] if history is True else "
E   +  "pageitem['imageinfo'][0] instead."]
=============================== warnings summary ===============================

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald Transcript
Xqt triaged this task as High priority.Jan 15 2021, 3:38 PM

Change 656440 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Ignore failing test_loadimageinfo for Python 3.5

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

Change 656440 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Ignore failing test_loadimageinfo for Python 3.5

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

JJMC89 assigned this task to Xqt.
JJMC89 removed a project: Patch-For-Review.