Page MenuHomePhabricator

Fix occasional failure of TestLogentries due to hidden namespace
Closed, ResolvedPublic

Description

https://travis-ci.org/wikimedia/pywikibot/jobs/392902641#L3898

____________________ TestLogentries.test_ProtectEntry_tewp _____________________
self = <tests.logentry_tests.TestLogentries testMethod=test_ProtectEntry_tewp>
    def wrapped_method(self):
        sitedata = self.sites[key]
        self.site_key = key
        self.family = sitedata['family']
        self.code = sitedata['code']
        self.site = sitedata['site']
>       func(self, key)
tests/aspects.py:785: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/logentry_tests.py:121: in test_logevent
    self._test_logevent(logtype)
tests/logentry_tests.py:106: in _test_logevent
    self.assertGreaterEqual(logentry.ns(), -2)
pywikibot/logentries.py:109: in ns
    return self.data['ns']
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = {'logid': 214298, 'actionhidden': '', 'type': 'protect', 'action': 'protect', 'user': 'Anomie', 'comment': 'Testing something related to protection', 'timestamp': '2018-06-15T16:59:28Z'}
key = 'ns'
    def __missing__(self, key):
        """Debug when the key is missing."""
        pywikibot.debug(u"API log entry received:\n" + repr(self),
                        _logger)
        if ((key in ('ns', 'title', 'pageid', 'logpage', 'params', 'action')
             and 'actionhidden' in self)
                or (key == 'comment' and 'commenthidden' in self)
                or (key == 'user' and 'userhidden' in self)):
            raise HiddenKeyError(
                "Log entry ({0}) has a hidden '{1}' key and you don't have "
>               'permission to view it.'.format(self._type, key))
E           pywikibot.exceptions.HiddenKeyError: Log entry (protect) has a hidden 'ns' key and you don't have permission to view it.
pywikibot/logentries.py:43: HiddenKeyError

Event Timeline

Dalba triaged this task as High priority.Jun 16 2018, 12:09 PM

Change 440744 had a related patch set uploaded (by Dalba; owner: dalba):
[pywikibot/core@master] Fix occasional failure of TestLogentries due to hidden namespace

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

Change 440744 merged by jenkins-bot:
[pywikibot/core@master] Fix occasional failure of TestLogentries due to hidden namespace

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

Vvjjkkii renamed this task from Fix occasional failure of TestLogentries due to hidden namespace to 1saaaaaaaa.Jul 1 2018, 1:03 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed Dalba as the assignee of this task.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.
CommunityTechBot renamed this task from 1saaaaaaaa to Fix occasional failure of TestLogentries due to hidden namespace.Jul 2 2018, 7:19 AM
CommunityTechBot closed this task as Resolved.
CommunityTechBot assigned this task to Dalba.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added subscribers: gerritbot, Aklapper.